mirror of
https://github.com/getgrav/grav.git
synced 2026-07-05 09:29:44 +02:00
Force redirect/route matching from start of route #1446
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
# v1.2.5
|
||||
## 04/xx/2017
|
||||
|
||||
1. [](#bugfix)
|
||||
* Fix to force route/redirect matching from the start of the route by default [1446](https://github.com/getgrav/grav/issues/1446)
|
||||
|
||||
# v1.2.4
|
||||
## 04/24/2017
|
||||
|
||||
|
||||
@@ -405,7 +405,7 @@ class Pages
|
||||
$site_redirects = $config->get("site.redirects");
|
||||
if (is_array($site_redirects)) {
|
||||
foreach ((array)$site_redirects as $pattern => $replace) {
|
||||
$pattern = '#' . $pattern . '#';
|
||||
$pattern = '#^' . preg_quote(ltrim($pattern, '^')) . '#';
|
||||
try {
|
||||
$found = preg_replace($pattern, $replace, $source_url);
|
||||
if ($found != $source_url) {
|
||||
@@ -421,7 +421,7 @@ class Pages
|
||||
$site_routes = $config->get("site.routes");
|
||||
if (is_array($site_routes)) {
|
||||
foreach ((array)$site_routes as $pattern => $replace) {
|
||||
$pattern = '#' . $pattern . '#';
|
||||
$pattern = '#^' . preg_quote(ltrim($pattern, '^')) . '#';
|
||||
try {
|
||||
$found = preg_replace($pattern, $replace, $source_url);
|
||||
if ($found != $source_url) {
|
||||
|
||||
Reference in New Issue
Block a user