MAPG-69 fix routing to handle emptry string properly

This commit is contained in:
bence committed 2020-06-21 15:44:40 +02:00
1 parent df60efbb8c
commit 87d476065d
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -64,7 +64,7 @@ class RouteCollection
throw new \Exception('Route already exists: ' . $id);
}
$pattern = array_merge($this->groupStack, explode('/', $pattern));
$pattern = array_merge($this->groupStack, $pattern === '' ? [] : explode('/', $pattern));
$route = new Route($id, $pattern, $handler);
$groupNumber = count($pattern);