Commit fac9b6ed authored by Crell's avatar Crell Committed by effulgentsia

Make use of the compiled regex when filtering routes by path, to account for...

Make use of the compiled regex when filtering routes by path, to account for default values and regex filters on placeholders.
parent 8306c5a3
......@@ -57,7 +57,10 @@ public function matchRequestPartial(Request $request) {
$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())) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment