From 3ac89c895de99a3741085553907030d47ae9703f Mon Sep 17 00:00:00 2001 From: Alexander Rutz Date: Thu, 10 Jan 2019 15:24:12 +0100 Subject: [PATCH 1/2] =?UTF-8?q?@jonmifsud=E2=80=99s=20[Fix=20for=20symphon?= =?UTF-8?q?y=202.6.x](https://github.com/symphonists/url=5Frouter/pull/25)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extension.driver.php | 4 ++-- extension.meta.xml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/extension.driver.php b/extension.driver.php index 1291f15..c401902 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) { diff --git a/extension.meta.xml b/extension.meta.xml index 3e69e95..8d87ef9 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -15,6 +15,9 @@ + + * @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 From dac56081570a01cc79f001fa983ca47c6e23933b Mon Sep 17 00:00:00 2001 From: animaux Date: Tue, 17 May 2022 10:57:18 +0200 Subject: [PATCH 2/2] =?UTF-8?q?PHP=C2=A08.1=20fix=20(may=20require=20PHP?= =?UTF-8?q?=207)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extension.driver.php | 4 +++- extension.meta.xml | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/extension.driver.php b/extension.driver.php index c401902..189cdc9 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -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 8d87ef9..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,9 @@ + + * PHP 8.1 fix (may require PHP 7) + * @jonmifsud’s [Fix for symphony 2.6.x](https://github.com/symphonists/url_router/pull/25)