mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 23:40:38 +01:00
removed checks that would send the user to 404 if the slug didn't match, restored old behaviour of redirecting to the correct slug. #3047
This commit is contained in:
@@ -43,15 +43,11 @@ topicsController.get = function(req, res, next) {
|
||||
function (results, next) {
|
||||
userPrivileges = results.privileges;
|
||||
|
||||
if (userPrivileges.disabled || (req.params.slug && tid + '/' + req.params.slug !== results.topic.slug)) {
|
||||
return helpers.notFound(req, res);
|
||||
}
|
||||
|
||||
if (!userPrivileges.read || (parseInt(results.topic.deleted, 10) && !userPrivileges.view_deleted)) {
|
||||
return helpers.notAllowed(req, res);
|
||||
}
|
||||
|
||||
if (!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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user