Merge pull request #2119 from Fusselwurm/patch-1

default for missing post_index parameter when topic pagination is used
This commit is contained in:
Julian Lam
2014-09-23 15:47:48 -04:00

View File

@@ -72,7 +72,7 @@ topicsController.get = function(req, res, next) {
postIndex = Math.max((req.params.post_index || 1) - (settings.postsPerPage + 1), 0);
}
} else if (!req.query.page) {
var index = Math.max(parseInt(req.params.post_index, 10), 0);
var index = Math.max(parseInt(req.params.post_index, 10), 0) || 0;
page = Math.ceil((index + 1) / settings.postsPerPage);
}