From 4de32052c2bf010d0f6bd5c87ffb3b7d99382758 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Tue, 11 Aug 2015 11:07:24 +0200 Subject: [PATCH] Prevent admin plugin to activate when the URL of a page contains its route. Fixes #45 --- admin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin.php b/admin.php index 8d2497dc..6c1978f5 100644 --- a/admin.php +++ b/admin.php @@ -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; } }