mirror of
https://github.com/processwire/processwire.git
synced 2025-08-12 09:44:38 +02:00
Fix trailing slash redirect issue with path hooks @bernhardbaumrock
This commit is contained in:
@@ -839,6 +839,7 @@ class WireHooks {
|
||||
$filters = array();
|
||||
$path = trim($path);
|
||||
$pathParts = explode('/', trim($path, '/'));
|
||||
$key = null;
|
||||
|
||||
foreach($pathParts as $index => $filter) {
|
||||
|
||||
@@ -869,6 +870,9 @@ class WireHooks {
|
||||
$filters[$key] = $filter;
|
||||
}
|
||||
|
||||
// trailing slash on last filter is optional
|
||||
if($key !== null) $filters[$key] = rtrim($filters[$key], '/');
|
||||
|
||||
$this->pathHooks[$id] = array(
|
||||
'match' => $path,
|
||||
'filters' => $filters,
|
||||
|
Reference in New Issue
Block a user