mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-04 20:36:03 +01:00
Fix redirect bug when changing admin route to admin-*
This commit is contained in:
@@ -779,7 +779,7 @@ class AdminPlugin extends Plugin
|
||||
// Special case to redirect after changing the admin route to avoid 'breaking'
|
||||
$obj = $event['object'];
|
||||
if (isset($obj->route) && $this->admin_route !== $obj->route) {
|
||||
$redirect = str_replace($this->admin_route, $obj->route, $this->uri->path() );
|
||||
$redirect = preg_replace('/^' . str_replace('/','\/',$this->admin_route) . '/',$obj->route,$this->uri->path());
|
||||
$this->grav->redirect($redirect);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user