@ -22,23 +22,23 @@ apiController.loadConfig = function (req, callback) {
config . siteTitle = validator . escape ( String ( meta . config . title || meta . config . browserTitle || 'NodeBB' ) ) ;
config . browserTitle = validator . escape ( String ( meta . config . browserTitle || meta . config . title || 'NodeBB' ) ) ;
config . titleLayout = ( meta . config . titleLayout || '{pageTitle} | {browserTitle}' ) . replace ( /{/g , '{' ) . replace ( /}/g , '}' ) ;
config . showSiteTitle = parseInt ( meta . config . showSiteTitle , 10 ) === 1 ;
config . showSiteTitle = meta . config . showSiteTitle === 1 ;
config . minimumTitleLength = meta . config . minimumTitleLength ;
config . maximumTitleLength = meta . config . maximumTitleLength ;
config . minimumPostLength = meta . config . minimumPostLength ;
config . maximumPostLength = meta . config . maximumPostLength ;
config . minimumTagsPerTopic = parseInt ( meta . config . minimumTagsPerTopic || 0 , 10 ) ;
config . maximumTagsPerTopic = parseInt ( meta . config . maximumTagsPerTopic || 5 , 10 ) ;
config . minimumTagsPerTopic = meta . config . minimumTagsPerTopic || 0 ;
config . maximumTagsPerTopic = meta . config . maximumTagsPerTopic || 5 ;
config . minimumTagLength = meta . config . minimumTagLength || 3 ;
config . maximumTagLength = meta . config . maximumTagLength || 15 ;
config . useOutgoingLinksPage = parseInt ( meta . config . useOutgoingLinksPage , 10 ) === 1 ;
config . allowGuestHandles = parseInt ( meta . config . allowGuestHandles , 10 ) === 1 ;
config . allowFileUploads = parseInt ( meta . config . allowFileUploads , 10 ) === 1 ;
config . allowTopicsThumbnail = parseInt ( meta . config . allowTopicsThumbnail , 10 ) === 1 ;
config . usePagination = parseInt ( meta . config . usePagination , 10 ) === 1 ;
config . disableChat = parseInt ( meta . config . disableChat , 10 ) === 1 ;
config . disableChatMessageEditing = parseInt ( meta . config . disableChatMessageEditing , 10 ) === 1 ;
config . maximumChatMessageLength = parseInt ( meta . config . maximumChatMessageLength , 10 ) || 1000 ;
config . useOutgoingLinksPage = meta . config . useOutgoingLinksPage === 1 ;
config . allowGuestHandles = meta . config . allowGuestHandles === 1 ;
config . allowFileUploads = meta . config . allowFileUploads === 1 ;
config . allowTopicsThumbnail = meta . config . allowTopicsThumbnail === 1 ;
config . usePagination = meta . config . usePagination === 1 ;
config . disableChat = meta . config . disableChat === 1 ;
config . disableChatMessageEditing = meta . config . disableChatMessageEditing === 1 ;
config . maximumChatMessageLength = meta . config . maximumChatMessageLength || 1000 ;
config . socketioTransports = nconf . get ( 'socket.io:transports' ) || [ 'polling' , 'websocket' ] ;
config . websocketAddress = nconf . get ( 'socket.io:address' ) || '' ;
config . maxReconnectionAttempts = meta . config . maxReconnectionAttempts || 5 ;
@ -53,15 +53,15 @@ apiController.loadConfig = function (req, callback) {
config . loggedIn = ! ! req . user ;
config . uid = req . uid ;
config [ 'cache-buster' ] = meta . config [ 'cache-buster' ] || '' ;
config . requireEmailConfirmation = parseInt ( meta . config . requireEmailConfirmation , 10 ) === 1 ;
config . requireEmailConfirmation = meta . config . requireEmailConfirmation === 1 ;
config . topicPostSort = meta . config . topicPostSort || 'oldest_to_newest' ;
config . categoryTopicSort = meta . config . categoryTopicSort || 'newest_to_oldest' ;
config . csrf _token = req . csrfToken && req . csrfToken ( ) ;
config . searchEnabled = plugins . hasListeners ( 'filter:search.query' ) ;
config . bootswatchSkin = meta . config . bootswatchSkin || 'noskin' ;
config . defaultBootswatchSkin = meta . config . bootswatchSkin || 'noskin' ;
config . enablePostHistory = parseInt ( meta . config . enablePostHistory || 1 , 10 ) === 1 ;
config . notificationAlertTimeout = parseInt ( meta . config . notificationAlertTimeout , 10 ) || 5000 ;
config . enablePostHistory = ( meta . config . enablePostHistory || 1 ) === 1 ;
config . notificationAlertTimeout = meta . config . notificationAlertTimeout || 5000 ;
if ( config . useOutgoingLinksPage ) {
config . outgoingLinksWhitelist = meta . config [ 'outgoingLinks:whitelist' ] ;
@ -71,7 +71,7 @@ apiController.loadConfig = function (req, callback) {
config . timeagoCutoff = timeagoCutoff !== '' ? Math . max ( 0 , parseInt ( timeagoCutoff , 10 ) ) : timeagoCutoff ;
config . cookies = {
enabled : parseInt ( meta . config . cookieConsentEnabled , 10 ) === 1 ,
enabled : meta . config . cookieConsentEnabled === 1 ,
message : translator . escape ( validator . escape ( meta . config . cookieConsentMessage || '[[global:cookies.message]]' ) ) . replace ( /\\/g , '\\\\' ) ,
dismiss : translator . escape ( validator . escape ( meta . config . cookieConsentDismiss || '[[global:cookies.accept]]' ) ) . replace ( /\\/g , '\\\\' ) ,
link : translator . escape ( validator . escape ( meta . config . cookieConsentLink || '[[global:cookies.learn_more]]' ) ) . replace ( /\\/g , '\\\\' ) ,
@ -95,7 +95,7 @@ apiController.loadConfig = function (req, callback) {
config . categoryTopicSort = settings . categoryTopicSort || config . categoryTopicSort ;
config . topicSearchEnabled = settings . topicSearchEnabled || false ;
config . delayImageLoading = settings . delayImageLoading !== undefined ? settings . delayImageLoading : true ;
config . bootswatchSkin = ( parseInt ( meta . config . disableCustomUserSkins , 10 ) !== 1 && settings . bootswatchSkin && settings . bootswatchSkin !== 'default' ) ? settings . bootswatchSkin : config . bootswatchSkin ;
config . bootswatchSkin = ( meta . config . disableCustomUserSkins !== 1 && settings . bootswatchSkin && settings . bootswatchSkin !== 'default' ) ? settings . bootswatchSkin : config . bootswatchSkin ;
plugins . fireHook ( 'filter:config.get' , config , next ) ;
} ,
] , callback ) ;