From 86f29ebe57cb48de326de375b0bbe37bcb972c66 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 21 Aug 2015 13:19:24 -0600 Subject: [PATCH] Fix for trailing `/` not matching active and activeChild paths #277 --- system/src/Grav/Common/Page/Page.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 278826661..aa6eaf70b 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -1710,7 +1710,7 @@ class Page */ public function active() { - $uri_path = self::getGrav()['uri']->path(); + $uri_path = rtrim(self::getGrav()['uri']->path(), '/'); $routes = self::getGrav()['pages']->routes(); if (isset($routes[$uri_path])) { @@ -1732,7 +1732,7 @@ class Page { $uri = self::getGrav()['uri']; $pages = self::getGrav()['pages']; - $uri_path = $uri->path(); + $uri_path = rtrim($uri->path(), '/'); $routes = self::getGrav()['pages']->routes(); if (isset($routes[$uri_path])) {