Make use of the compiled regex when filtering routes by path, to account for default values and regex filters on placeholders.
parent
8306c5a32a
commit
fac9b6ed0e
|
@ -57,7 +57,10 @@ class PathMatcher implements InitialMatcherInterface {
|
|||
|
||||
$collection = new RouteCollection();
|
||||
foreach ($routes as $name => $route) {
|
||||
$collection->add($name, unserialize($route));
|
||||
$route = unserialize($route);
|
||||
if (preg_match($route->compile()->getRegex(), $path, $matches)) {
|
||||
$collection->add($name, $route);
|
||||
}
|
||||
}
|
||||
|
||||
if (!count($collection->all())) {
|
||||
|
|
Loading…
Reference in New Issue