diff --git a/public/src/app.js b/public/src/app.js index de2ac9557c..766c8755a7 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -269,8 +269,8 @@ var socket, selector = selector || $('a'); selector.each(function() { var href = $(this).attr('href'); - if (href && app.userslug) { - $(this).attr('href', href.replace(/\[self\]/g, app.userslug)); + if (href && app.userslug && href.indexOf('_') !== -1) { + $(this).attr('href', href.replace(/_/g, app.userslug)); } }); }; diff --git a/src/categories/recentreplies.js b/src/categories/recentreplies.js index 23f6560be5..cbf5f5cd8b 100644 --- a/src/categories/recentreplies.js +++ b/src/categories/recentreplies.js @@ -17,9 +17,17 @@ module.exports = function(Categories) { return callback(null, []); } - posts.getPostsFromSet('cid:' + cid + ':pids', uid, 0, count - 1, function(err, data) { - callback(err, data ? data.posts : []); - }); + async.waterfall([ + function(next) { + db.getSortedSetRevRange('cid:' + cid + ':pids', 0, count - 1, next); + }, + function(pids, next) { + privileges.posts.filter('read', pids, uid, next); + }, + function(pids, next) { + posts.getPostSummaryByPids(pids, uid, {stripTags: true}, next); + } + ], callback); }; Categories.getRecentTopicReplies = function(categoryData, uid, callback) {