mirror of
https://github.com/getgrav/grav.git
synced 2025-10-26 07:56:07 +01:00
Fixed site redirect with redirect code failing when redirecting to sub-pages [#3035]
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
* Fixed Markdown image attribute `loading` [#3251](https://github.com/getgrav/grav/pull/3251)
|
||||
* Fixed `Uri::isValidExtension()` returning false positives
|
||||
* Fixed `page.html` returning duplicated content with `system.pages.redirect_default_route` turned on [#3130](https://github.com/getgrav/grav/issues/3130)
|
||||
* Fixed site redirect with redirect code failing when redirecting to sub-pages [#3035](https://github.com/getgrav/grav/pull/3035/files)
|
||||
|
||||
# v1.7.7
|
||||
## 02/23/2021
|
||||
|
||||
@@ -431,8 +431,8 @@ class Grav extends Container
|
||||
}
|
||||
|
||||
if (null === $code) {
|
||||
// Check for code in route
|
||||
$regex = '/.*(\[(30[1-7])\])$/';
|
||||
// Check for redirect code in the route: e.g. /new/[301], /new[301]/route or /new[301].html
|
||||
$regex = '/.*(\[(30[1-7])\])(.\w+|\/.*?)?$/';
|
||||
preg_match($regex, $route, $matches);
|
||||
if ($matches) {
|
||||
$route = str_replace($matches[1], '', $matches[0]);
|
||||
|
||||
Reference in New Issue
Block a user