Skip to content

Commit

Permalink
fix: reverse routing returns invalid route when '' is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Oct 10, 2023
1 parent e1e9a7b commit 61f080e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions system/Router/RouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,10 @@ public function environment(string $env, Closure $callback): RouteCollectionInte
*/
public function reverseRoute(string $search, ...$params)
{
if ($search === '') {
return false;
}

// Named routes get higher priority.
foreach ($this->routesNames as $verb => $collection) {
if (array_key_exists($search, $collection)) {
Expand Down

0 comments on commit 61f080e

Please sign in to comment.