1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-12 01:34:31 +02:00

Fix trailing slash redirect issue with path hooks @bernhardbaumrock

This commit is contained in:
Ryan Cramer
2021-04-09 16:22:06 -04:00
parent c3f07f9460
commit 7918780af1

View File

@@ -839,6 +839,7 @@ class WireHooks {
$filters = array();
$path = trim($path);
$pathParts = explode('/', trim($path, '/'));
$key = null;
foreach($pathParts as $index => $filter) {
@@ -868,6 +869,9 @@ class WireHooks {
$key = $pos === 0 && $index === 0 ? 0 : $index + 1;
$filters[$key] = $filter;
}
// trailing slash on last filter is optional
if($key !== null) $filters[$key] = rtrim($filters[$key], '/');
$this->pathHooks[$id] = array(
'match' => $path,