From 47a23772298370f920075e020d63d0f5fff671f9 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 24 Apr 2015 10:39:24 -0400 Subject: [PATCH] closes #3089 --- src/controllers/categories.js | 2 +- src/controllers/topics.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/controllers/categories.js b/src/controllers/categories.js index e86bbce574..8c45cdc86e 100644 --- a/src/controllers/categories.js +++ b/src/controllers/categories.js @@ -159,7 +159,7 @@ categoriesController.list = function(req, res, next) { categoriesController.get = function(req, res, next) { var cid = req.params.category_id, - page = req.query.page || 1, + page = parseInt(req.query.page, 10) || 1, userPrivileges; if (req.params.topic_index && !utils.isNumber(req.params.topic_index)) { diff --git a/src/controllers/topics.js b/src/controllers/topics.js index 9db26b8f4f..1548e29861 100644 --- a/src/controllers/topics.js +++ b/src/controllers/topics.js @@ -18,7 +18,6 @@ var topicsController = {}, topicsController.get = function(req, res, next) { var tid = req.params.topic_id, - page = 1, sort = req.query.sort, userPrivileges; @@ -82,7 +81,7 @@ topicsController.get = function(req, res, next) { } var postIndex = 0; - page = parseInt(req.query.page, 10) || 1; + var page = parseInt(req.query.page, 10) || 1; req.params.post_index = parseInt(req.params.post_index, 10) || 0; if (reverse && req.params.post_index === 1) { req.params.post_index = 0;