Skip to content

Commit

Permalink
Fix bug where regex replacements are greedy.
Browse files Browse the repository at this point in the history
  • Loading branch information
switchplane-tom committed Jun 23, 2023
1 parent 3c5e3ae commit 0b989c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function getPath(?array $replacements = null): string
$toReplace = [];

foreach ($replacements as $wildcard => $actual) {
$toReplace['/{' . preg_quote($wildcard, '/') . '(:.*)?}/'] = $actual;
$toReplace['/{' . preg_quote($wildcard, '/') . '(:.*)?}/U'] = $actual;
}

$segments = [];
Expand Down

0 comments on commit 0b989c4

Please sign in to comment.