mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-04-04 19:58:49 +02:00
Update admin.php (#1409)
Fix for https://github.com/getgrav/grav-plugin-admin/issues/1408
This commit is contained in:
committed by
Andy Miller
parent
acb1e33a04
commit
7025f2fa2b
10
admin.php
10
admin.php
@@ -792,11 +792,13 @@ class AdminPlugin extends Plugin
|
||||
{
|
||||
// Special case to redirect after changing the admin route to avoid 'breaking'
|
||||
$obj = $event['object'];
|
||||
$blueprint = $obj->blueprints()->getFilename();
|
||||
if (!is_null($event['object'])) {
|
||||
$blueprint = $obj->blueprints()->getFilename();
|
||||
|
||||
if ($blueprint == 'admin/blueprints' && isset($obj->route) && $this->admin_route !== $obj->route) {
|
||||
$redirect = preg_replace('/^' . str_replace('/','\/',$this->admin_route) . '/',$obj->route,$this->uri->path());
|
||||
$this->grav->redirect($redirect);
|
||||
if ($blueprint == 'admin/blueprints' && isset($obj->route) && $this->admin_route !== $obj->route) {
|
||||
$redirect = preg_replace('/^' . str_replace('/','\/',$this->admin_route) . '/',$obj->route,$this->uri->path());
|
||||
$this->grav->redirect($redirect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user