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

@@ -188,15 +188,11 @@ categoriesController.get = function(req, res, next) {
return helpers.notFound(req, res);
}
if (req.params.slug && cid + '/' + req.params.slug !== results.categoryData.slug) {
return helpers.notFound(req, res);
}
if (!results.privileges.read) {
return helpers.notAllowed(req, res);
}
if (!req.params.slug && results.categoryData.slug && results.categoryData.slug !== cid + '/') {
if ((!req.params.slug || results.categoryData.slug !== cid + '/' + req.params.slug) && (results.categoryData.slug && results.categoryData.slug !== cid + '/')) {
return helpers.redirect(res, '/category/' + encodeURI(results.categoryData.slug));
}