mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-01-06 15:43:01 +01:00
Prevent admin plugin to activate when the URL of a page contains its route. Fixes #45
This commit is contained in:
@@ -91,9 +91,9 @@ class AdminPlugin extends Plugin
|
||||
$this->base = '/' . trim($route, '/');
|
||||
$this->uri = $this->grav['uri'];
|
||||
|
||||
|
||||
// Only activate admin if we're inside the admin path.
|
||||
if (substr($this->uri->route(), 0, strlen($this->base)) == $this->base) {
|
||||
if ($this->uri->route() == $this->base ||
|
||||
substr($this->uri->route(), 0, strlen($this->base) + 1) == $this->base . '/') {
|
||||
$this->active = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user