mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
parent
e9e99371a6
commit
7ee3235a68
1 changed files with 1 additions and 6 deletions
|
@ -118,12 +118,7 @@ function activateTheme(activeTheme) {
|
||||||
// Uses the URL to detect whether this response should be an admin response
|
// Uses the URL to detect whether this response should be an admin response
|
||||||
// This is used to ensure the right content is served, and is not for security purposes
|
// This is used to ensure the right content is served, and is not for security purposes
|
||||||
function manageAdminAndTheme(req, res, next) {
|
function manageAdminAndTheme(req, res, next) {
|
||||||
// TODO improve this regex
|
res.isAdmin = req.url.lastIndexOf(config.paths().webroot + '/ghost/', 0) === 0;
|
||||||
if (config.paths().path === '/') {
|
|
||||||
res.isAdmin = /(^\/ghost\/)/.test(req.url);
|
|
||||||
} else {
|
|
||||||
res.isAdmin = new RegExp("^\\" + config.paths().path + "\\/ghost\\/").test(req.url);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (res.isAdmin) {
|
if (res.isAdmin) {
|
||||||
expressServer.enable('admin');
|
expressServer.enable('admin');
|
||||||
|
|
Loading…
Reference in a new issue