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:
Julian Lam
2015-04-18 14:47:04 -04:00
parent da5909349b
commit 8ee40ece71
2 changed files with 2 additions and 10 deletions

View File

@@ -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));
}