Skip to content

Commit

Permalink
Add ? to prvent too greedy matching
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Weinmann authored and Eredost committed Oct 3, 2022
1 parent 9dd8ad6 commit 3ed6ff8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function generateUrl(string $routeName, array $parameters = []): string
$paramName
));
}
$path = preg_replace('/{' . $paramName . '(<.+>)?}/', $parameters[$paramName], $path);
$path = preg_replace('/{' . $paramName . '(<.+?>)?}/', $parameters[$paramName], $path);
}
}

Expand Down

0 comments on commit 3ed6ff8

Please sign in to comment.