diff --git a/CHANGELOG.md b/CHANGELOG.md index b586a0caa..df0f124d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 1. [](#bugfix) * Dynamically added pages via `Pages::addPage()` were not firing `onPageProcessed()` event causing forms not to be processed + * Fixed `Page::active()` and `Page::activeChild()` to work with UTF-8 characters in the URL [#1727](https://github.com/getgrav/grav/issues/1727) 1. [](#improved) * Added `Medium::copy()` method to create a copy of a medium object diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 781bccb72..f0720e16f 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -2295,7 +2295,7 @@ class Page */ public function active() { - $uri_path = rtrim(Grav::instance()['uri']->path(), '/') ?: '/'; + $uri_path = rtrim(urldecode(Grav::instance()['uri']->path()), '/') ?: '/'; $routes = Grav::instance()['pages']->routes(); if (isset($routes[$uri_path])) { @@ -2318,7 +2318,7 @@ class Page { $uri = Grav::instance()['uri']; $pages = Grav::instance()['pages']; - $uri_path = rtrim($uri->path(), '/'); + $uri_path = rtrim(urldecode($uri->path()), '/'); $routes = Grav::instance()['pages']->routes(); if (isset($routes[$uri_path])) {