mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
closes #2368
This commit is contained in:
@@ -60,11 +60,8 @@ topicsController.get = function(req, res, next) {
|
||||
|
||||
if (utils.isNumber(req.params.post_index)) {
|
||||
var url = '';
|
||||
if (req.params.post_index > postCount) {
|
||||
url = '/topic/' + req.params.topic_id + '/' + req.params.slug + '/' + postCount;
|
||||
return res.locals.isAPI ? res.status(302).json(url) : res.redirect(url);
|
||||
} else if (req.params.post_index < 1) {
|
||||
url = '/topic/' + req.params.topic_id + '/' + req.params.slug;
|
||||
if (req.params.post_index < 1 || req.params.post_index > postCount) {
|
||||
url = '/topic/' + req.params.topic_id + '/' + req.params.slug + (req.params.post_index > postCount ? '/' + postCount : '');
|
||||
return res.locals.isAPI ? res.status(302).json(url) : res.redirect(url);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user