mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
fix topic titles in search results
titles were being escaped twice if two or more posts were from the same topic
This commit is contained in:
@@ -271,6 +271,9 @@ var async = require('async'),
|
|||||||
}
|
}
|
||||||
|
|
||||||
var cids = topics.map(function(topic) {
|
var cids = topics.map(function(topic) {
|
||||||
|
if (topic) {
|
||||||
|
topic.title = validator.escape(topic.title);
|
||||||
|
}
|
||||||
return topic && topic.cid;
|
return topic && topic.cid;
|
||||||
}).filter(function(value, index, array) {
|
}).filter(function(value, index, array) {
|
||||||
return value && array.indexOf(value) === index;
|
return value && array.indexOf(value) === index;
|
||||||
@@ -320,9 +323,7 @@ var async = require('async'),
|
|||||||
async.map(posts, function(post, next) {
|
async.map(posts, function(post, next) {
|
||||||
post.user = results.users[post.uid];
|
post.user = results.users[post.uid];
|
||||||
post.topic = results.topics[post.tid];
|
post.topic = results.topics[post.tid];
|
||||||
post.topic.title = validator.escape(post.topic.title);
|
|
||||||
post.category = results.categories[post.topic.cid];
|
post.category = results.categories[post.topic.cid];
|
||||||
|
|
||||||
post.relativeTime = utils.toISOString(post.timestamp);
|
post.relativeTime = utils.toISOString(post.timestamp);
|
||||||
|
|
||||||
if (!post.content || !options.parse) {
|
if (!post.content || !options.parse) {
|
||||||
|
|||||||
Reference in New Issue
Block a user