diff --git a/extension.driver.php b/extension.driver.php index 1291f15..189cdc9 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -234,11 +234,11 @@ public function frontendPrePageResolve($context) if (isset($page_can_resolve['filelocation'])) { // Remove the PAGES path, .xsl and replace any _ with /. // Basically reconstruct the 'path' as if it was a URL request - $resolved_path = '/' . str_replace( + $resolved_path = str_replace( array(PAGES . '/', '.xsl', '_'), array('', '', '/'), $page_can_resolve['filelocation'] - ) . '/'; + ); // Now does the page we're routing from already exist in Symphony? No? Redirect. if (preg_match('~^' . preg_quote($resolved_path) . '~i', $route['original']) == false) { @@ -273,7 +273,9 @@ public function frontendPrePageResolve($context) else { $index = PageManager::fetchPageByType('index'); - + $index['handle'] = $index['handle'] ?? null; + + if(!$page_can_resolve) { $context['page'] = "/" . $index['handle'] . $context['page']; diff --git a/extension.meta.xml b/extension.meta.xml index 3e69e95..c9dde72 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -2,7 +2,7 @@ URL Router Regex and Simplified Parameter based URL re-routing - https://github.com/symphonists/url_router + https://github.com/animaux/url_router http://getsymphony.com/discuss/thread/37320/ https://github.com/symphonists/url_router/issues @@ -15,6 +15,12 @@ + + * PHP 8.1 fix (may require PHP 7) + + + * @jonmifsud’s [Fix for symphony 2.6.x](https://github.com/symphonists/url_router/pull/25) + * [#20](https://github.com/symphonists/url_router/issues/20) Fix routing on Symphony 2.4+ * Use `PageManager` instead of internal functions