* Fix #5592
Escape translation tokens in topic titles, descriptions, profile about, and post contents

* Fix tests
This commit is contained in:
Peter Jaszkowiak
2017-04-13 12:37:54 -06:00
committed by psychobunny
parent c3febca9c8
commit 1fb48ef7a7
9 changed files with 31 additions and 18 deletions

View File

@@ -14,6 +14,7 @@ var plugins = require('../plugins');
var helpers = require('./helpers');
var pagination = require('../pagination');
var utils = require('../utils');
var translator = require('../translator');
var topicsController = {};
@@ -129,13 +130,14 @@ topicsController.get = function (req, res, callback) {
plugins.fireHook('filter:controllers.topic.get', { topicData: topicData, uid: req.uid }, next);
},
function (data, next) {
data.topicData.title = translator.escape(data.topicData.title);
var breadcrumbs = [
{
text: data.topicData.category.name,
url: nconf.get('relative_path') + '/category/' + data.topicData.category.slug,
},
{
text: data.topicData.title,
text: translator.escape(data.topicData.title),
},
];