⏱️ Replace preg_replace in tokenize with str_replace
This commit is contained in:
parent
236612125e
commit
559196be54
|
@ -131,12 +131,12 @@ class Router
|
|||
$matches = $matches[1];
|
||||
|
||||
foreach ($matches as $match) {
|
||||
$pattern = "/(?:{".$match."})+/";
|
||||
$pattern = '{'.$match.'}';
|
||||
|
||||
if (in_array($match, $constraints)) {
|
||||
$uri = preg_replace($pattern, '('.self::$constraints[$match].')', $uri);
|
||||
$uri = str_replace($pattern, '('.self::$constraints[$match].')', $uri);
|
||||
} else {
|
||||
$uri = preg_replace($pattern, self::$defaultConstraint, $uri);
|
||||
$uri = str_replace($pattern, self::$defaultConstraint, $uri);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user