1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-15 03:05:26 +02:00
This commit is contained in:
Ryan Cramer
2025-02-14 14:43:37 -05:00
parent 9996091afb
commit 668081fb23

View File

@@ -1275,6 +1275,15 @@ class WireHooks {
$regexDelim = $matchPath[0];
} else {
// needs to be in regex format
if(strpos($matchPath, '.') !== false) {
// preserve some regex sequences containing periods
$r = [ '.+' => '•+', '.*' => '•*', '\\.' => '\\•' ];
$matchPath = str_replace(array_keys($r), array_values($r), $matchPath);
// force any remaining periods to be taken literally
$matchPath = str_replace('.', '\\.', $matchPath);
// restore regex sequences containing periods
$matchPath = str_replace(array_values($r), array_keys($r), $matchPath);
}
if(strpos($matchPath, '/') === 0) $matchPath = "^$matchPath";
$matchPath = "#$matchPath$#";
}