mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 18:52:14 +03:00
Merge pull request #811 from cgiffard/ugly-settings-404
Settings: Return 404 for unrecognised pages
This commit is contained in:
commit
f661ad9a63
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user