Skip to content

Node.js based forum software built for the modern web

closes #3113

barisusaklia924c456b9b3
diff --git a/src/controllers/categories.js b/src/controllers/categories.js
index 80bf87907a..53ad658966 100644
--- a/src/controllers/categories.js
+++ b/src/controllers/categories.js
@@ -162,7 +162,7 @@ categoriesController.get = function(req, res, next) {
page = parseInt(req.query.page, 10) || 1,
userPrivileges;
- if (req.params.topic_index && !utils.isNumber(req.params.topic_index)) {
+ if ((req.params.topic_index && !utils.isNumber(req.params.topic_index)) || !utils.isNumber(cid)) {
return helpers.notFound(req, res);
}
diff --git a/src/controllers/topics.js b/src/controllers/topics.js
index 3f96682c31..b65b3b997a 100644
--- a/src/controllers/topics.js
+++ b/src/controllers/topics.js
@@ -21,7 +21,7 @@ topicsController.get = function(req, res, next) {
sort = req.query.sort,
userPrivileges;
- if (req.params.post_index && !utils.isNumber(req.params.post_index)) {
+ if ((req.params.post_index && !utils.isNumber(req.params.post_index)) || !utils.isNumber(tid)) {
return helpers.notFound(req, res);
}