v1.18.x
Baris Usakli 10 years ago committed by Julian Lam
parent 64468a6f16
commit 8522af504a

@ -6,6 +6,7 @@ var pkg = require('./../../package.json'),
plugins = require('./../plugins'),
widgets = require('../widgets'),
validator = require('validator'),
nconf = require('nconf');
var apiController = {};
@ -16,7 +17,7 @@ apiController.getConfig = function(req, res, next) {
config.socketioTransports = nconf.get('socket.io:transports') || ['polling', 'websocket'];
config.websocketAddress = nconf.get('socket.io:address') || '';
config.version = pkg.version;
config.siteTitle = meta.config.title || meta.config.browserTitle || 'NodeBB';
config.siteTitle = validator.escape(meta.config.title || meta.config.browserTitle || 'NodeBB');
config.showSiteTitle = parseInt(meta.config.showSiteTitle, 10) === 1;
config.postDelay = meta.config.postDelay;
config.minimumTitleLength = meta.config.minimumTitleLength;

@ -43,13 +43,13 @@ Controllers.home = function(req, res, next) {
header: function (next) {
res.locals.metaTags = [{
name: "title",
content: meta.config.title || 'NodeBB'
content: validator.escape(meta.config.title || 'NodeBB')
}, {
name: "description",
content: meta.config.description || ''
content: validator.escape(meta.config.description || '')
}, {
property: 'og:title',
content: 'Index | ' + (meta.config.title || 'NodeBB')
content: 'Index | ' + validator.escape(meta.config.title || 'NodeBB')
}, {
property: 'og:type',
content: 'website'

@ -17,7 +17,7 @@ module.exports = function(Meta) {
Meta.title.build = function (urlFragment, language, locals, callback) {
var uri = '';
var fallbackTitle = Meta.config.browserTitle || Meta.config.title || 'NodeBB';
var fallbackTitle = validator.escape(Meta.config.browserTitle || Meta.config.title || 'NodeBB');
try {
uri = decodeURIComponent(urlFragment);
} catch(e) {

Loading…
Cancel
Save