mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-01 15:29:19 +03:00
🐛 Modify regex to allow subdir/ghost urls. (#8627)
no issue - redirect admin url's if Ghost uses a subdirectory - fixes a bug where reset password and invite links do not route to the right destination
This commit is contained in:
parent
21d7791eae
commit
c2e47f89ba
@ -1,7 +1,10 @@
|
||||
var utils = require('../utils');
|
||||
|
||||
function redirectAdminUrls(req, res, next) {
|
||||
var ghostPathMatch = req.originalUrl.match(/^\/ghost\/(.+)$/);
|
||||
var subdir = utils.url.getSubdir(),
|
||||
ghostPathRegex = new RegExp('^' + subdir + '/ghost/(.+)'),
|
||||
ghostPathMatch = req.originalUrl.match(ghostPathRegex);
|
||||
|
||||
if (ghostPathMatch) {
|
||||
return res.redirect(utils.url.urlJoin(utils.url.urlFor('admin'), '#', ghostPathMatch[1]));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user