Fixed incorrect routing with setup.php based base [#1892]

This commit is contained in:
Matias Griese
2018-06-14 14:55:08 +03:00
parent ecdbff68d8
commit 2e3a64fcef
2 changed files with 2 additions and 2 deletions

View File

@@ -8,6 +8,7 @@
* Handle `errors.display` system property better in admin plugin [admin#1452](https://github.com/getgrav/grav-plugin-admin/issues/1452)
* Fix classes on non-http based protocol links [#2034](https://github.com/getgrav/grav/issues/2034)
* Fixed crash on IIS (Windows) with open_basedir in effect [#2053](https://github.com/getgrav/grav/issues/2053)
* Fixed incorrect routing with setup.php based base [#1892](https://github.com/getgrav/grav/issues/1892)
# v1.4.5
## 05/15/2018

View File

@@ -150,11 +150,10 @@ class Uri
$uri = str_replace(static::filterPath($this->root), '', $this->url);
// remove the setup.php based base if set:
$setup_base = $grav['pages']->base();
if ($setup_base) {
$uri = str_replace($setup_base, '', $uri);
$uri = preg_replace('|^' . preg_quote($setup_base, '|') . '|', '', $uri);
}
// If configured to, redirect trailing slash URI's with a 302 redirect