Merge pull request #811 from cgiffard/ugly-settings-404

Settings: Return 404 for unrecognised pages
This commit is contained in:
Hannah Wolfe 2013-09-17 19:47:19 -07:00
commit f661ad9a63

View File

@ -260,7 +260,17 @@ adminControllers = {
adminNav: setSelected(adminNavbar, 'content')
});
},
'settings': function (req, res) {
'settings': function (req, res, next) {
// TODO: Centralise list/enumeration of settings panes, so we don't
// run into trouble in future.
var allowedSections = ["", "general", "user"],
section = req.url.replace(/(^\/ghost\/settings[\/]*|\/$)/ig, "");
if (allowedSections.indexOf(section) < 0) {
return next();
}
res.render('settings', {
bodyClass: 'settings',
adminNav: setSelected(adminNavbar, 'settings')