mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
closes #2117
This commit is contained in:
@@ -21,6 +21,10 @@ topicsController.get = function(req, res, next) {
|
||||
uid = req.user ? req.user.uid : 0,
|
||||
userPrivileges;
|
||||
|
||||
if (req.params.post_index && !utils.isNumber(req.params.post_index)) {
|
||||
return categoriesController.notFound(req, res);
|
||||
}
|
||||
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
async.parallel({
|
||||
@@ -32,6 +36,9 @@ topicsController.get = function(req, res, next) {
|
||||
},
|
||||
settings: function(next) {
|
||||
user.getSettings(uid, next);
|
||||
},
|
||||
slug: function(next) {
|
||||
topics.getTopicField(tid, 'slug', next);
|
||||
}
|
||||
}, next);
|
||||
},
|
||||
@@ -55,6 +62,10 @@ topicsController.get = function(req, res, next) {
|
||||
return categoriesController.notFound(req, res);
|
||||
}
|
||||
|
||||
if (tid + '/' + req.params.slug !== results.slug) {
|
||||
return categoriesController.notFound(req, res);
|
||||
}
|
||||
|
||||
if (!userPrivileges.read) {
|
||||
return categoriesController.notAllowed(req, res);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user