Skip to content

Commit 61f080e

Browse files
committed
fix: reverse routing returns invalid route when '' is passed
1 parent e1e9a7b commit 61f080e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

system/Router/RouteCollection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,10 @@ public function environment(string $env, Closure $callback): RouteCollectionInte
11561156
*/
11571157
public function reverseRoute(string $search, ...$params)
11581158
{
1159+
if ($search === '') {
1160+
return false;
1161+
}
1162+
11591163
// Named routes get higher priority.
11601164
foreach ($this->routesNames as $verb => $collection) {
11611165
if (array_key_exists($search, $collection)) {

0 commit comments

Comments
 (0)