From 03d432182b36d5bd966e92ba4c47816e966b36f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Zanghelini?= Date: Mon, 3 Apr 2017 13:45:43 -0300 Subject: [PATCH] Fix postcount is expected to be Number (#5567) --- src/controllers/topics.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/controllers/topics.js b/src/controllers/topics.js index 1d813868ae..adfad461e2 100644 --- a/src/controllers/topics.js +++ b/src/controllers/topics.js @@ -67,6 +67,7 @@ topicsController.get = function (req, res, callback) { settings = results.settings; var postCount = parseInt(results.topic.postcount, 10); pageCount = Math.max(1, Math.ceil(postCount / settings.postsPerPage)); + results.topic.postcount = postCount; if (utils.isNumber(req.params.post_index) && (req.params.post_index < 1 || req.params.post_index > postCount)) { return helpers.redirect(res, '/topic/' + req.params.topic_id + '/' + req.params.slug + (req.params.post_index > postCount ? '/' + postCount : ''));