mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-05 04:46:03 +01:00
Fix redirect bug when changing admin route to admin-*
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
1. [](#improved)
|
1. [](#improved)
|
||||||
* Table CSS improvements for use in 3rd party plugins
|
* Table CSS improvements for use in 3rd party plugins
|
||||||
|
1. [](#bugfix)
|
||||||
|
* Fix redirect bug when changing admin route to `admin-*`
|
||||||
|
|
||||||
# v1.7.1
|
# v1.7.1
|
||||||
## 03/11/2018
|
## 03/11/2018
|
||||||
|
|||||||
@@ -779,7 +779,7 @@ class AdminPlugin extends Plugin
|
|||||||
// Special case to redirect after changing the admin route to avoid 'breaking'
|
// Special case to redirect after changing the admin route to avoid 'breaking'
|
||||||
$obj = $event['object'];
|
$obj = $event['object'];
|
||||||
if (isset($obj->route) && $this->admin_route !== $obj->route) {
|
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);
|
$this->grav->redirect($redirect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user