changed to title raw

v1.18.x
Barış Soner Uşaklı 9 years ago
parent ef48b5d13e
commit 573840ccbd

@ -217,7 +217,7 @@ define('forum/topic', [
function updateTopicTitle() { function updateTopicTitle() {
var span = components.get('navbar/title').find('span'); var span = components.get('navbar/title').find('span');
if ($(window).scrollTop() > 50) { if ($(window).scrollTop() > 50) {
span.html(ajaxify.data.titleEscaped).show(); span.html(ajaxify.data.title).show();
} else { } else {
span.html('').hide(); span.html('').hide();
} }

@ -194,7 +194,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
slug: ajaxify.data.slug, slug: ajaxify.data.slug,
index: getData(button, 'data-index'), index: getData(button, 'data-index'),
pid: toPid, pid: toPid,
topicName: ajaxify.data.title, topicName: ajaxify.data.titleRaw,
username: username, username: username,
text: selectionText text: selectionText
}); });
@ -202,7 +202,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
$(window).trigger('action:composer.post.new', { $(window).trigger('action:composer.post.new', {
tid: tid, tid: tid,
pid: toPid, pid: toPid,
topicName: ajaxify.data.title, topicName: ajaxify.data.titleRaw,
text: username ? username + ' ' : '' text: username ? username + ' ' : ''
}); });
} }
@ -227,7 +227,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
index: getData(button, 'data-index'), index: getData(button, 'data-index'),
pid: pid, pid: pid,
username: username, username: username,
topicName: ajaxify.data.title, topicName: ajaxify.data.titleRaw,
text: post text: post
}); });
}); });

@ -131,7 +131,7 @@ topicsController.get = function(req, res, callback) {
url: nconf.get('relative_path') + '/category/' + data.topicData.category.slug url: nconf.get('relative_path') + '/category/' + data.topicData.category.slug
}, },
{ {
text: validator.escape(data.topicData.title) text: data.topicData.title
} }
]; ];

@ -58,7 +58,8 @@ module.exports = function(Topics) {
if (!topic) { if (!topic) {
return; return;
} }
topic.titleEscaped = validator.escape(topic.title); topic.titleRaw = topic.title;
topic.title = validator.escape(topic.title);
topic.relativeTime = utils.toISOString(topic.timestamp); topic.relativeTime = utils.toISOString(topic.timestamp);
topic.lastposttimeISO = utils.toISOString(topic.lastposttime); topic.lastposttimeISO = utils.toISOString(topic.lastposttime);
} }

@ -154,8 +154,8 @@ describe('Topic\'s', function() {
assert.ifError(err); assert.ifError(err);
topics.getTopicData(result.topicData.tid, function(err, topicData) { topics.getTopicData(result.topicData.tid, function(err, topicData) {
assert.ifError(err); assert.ifError(err);
assert.strictEqual(topicData.titleEscaped, titleEscaped); assert.strictEqual(topicData.titleRaw, title);
assert.strictEqual(topicData.title, title); assert.strictEqual(topicData.title, titleEscaped);
done(); done();
}); });
}); });

Loading…
Cancel
Save