mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
fix #4350; When redirecting to fix slug, preserve any provided post_index
This commit is contained in:
@@ -55,7 +55,11 @@ topicsController.get = function(req, res, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((!req.params.slug || results.topic.slug !== tid + '/' + req.params.slug) && (results.topic.slug && results.topic.slug !== tid + '/')) {
|
if ((!req.params.slug || results.topic.slug !== tid + '/' + req.params.slug) && (results.topic.slug && results.topic.slug !== tid + '/')) {
|
||||||
return helpers.redirect(res, '/topic/' + encodeURI(results.topic.slug));
|
var url = '/topic/' + encodeURI(results.topic.slug);
|
||||||
|
if (req.params.post_index){
|
||||||
|
url += '/'+req.params.post_index;
|
||||||
|
}
|
||||||
|
return helpers.redirect(res, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
var settings = results.settings;
|
var settings = results.settings;
|
||||||
|
|||||||
Reference in New Issue
Block a user