Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions extension.driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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'];
Expand Down
8 changes: 7 additions & 1 deletion extension.meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<extension id="url_router" status="released" xmlns="http://getsymphony.com/schemas/extension/1.0">
<name>URL Router</name>
<description>Regex and Simplified Parameter based URL re-routing</description>
<repo type="github">https://github.com/symphonists/url_router</repo>
<repo type="github">https://github.com/animaux/url_router</repo>
<url type="discuss">http://getsymphony.com/discuss/thread/37320/</url>
<url type="issues">https://github.com/symphonists/url_router/issues</url>
<types>
Expand All @@ -15,6 +15,12 @@
</author>
</authors>
<releases>
<release version="3.2.1" date="2022-05-17" min="2.7.10" max="2.x.x">
* PHP 8.1 fix (may require PHP 7)
</release>
<release version="3.2" date="2019-01-10" min="2.6" max="2.x.x">
* @jonmifsud’s [Fix for symphony 2.6.x](https://github.com/symphonists/url_router/pull/25)
</release>
<release version="3.1" date="2014-10-29" min="2.4" max="2.5.x">
* [#20](https://github.com/symphonists/url_router/issues/20) Fix routing on Symphony 2.4+
* Use `PageManager` instead of internal functions
Expand Down