mirror of
https://github.com/getgrav/grav.git
synced 2026-07-10 00:23:28 +02:00
Fix active() + activeChild() to work with UTF-8 #1727
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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])) {
|
||||
|
||||
Reference in New Issue
Block a user