8000 Correct $uri when ['prefix' => ''] and ['prefix' => '/']. · laravel/lumen-framework@ae73cf1 · GitHub
[go: up one dir, main page]

Skip to content

Commit ae73cf1

Browse files
committed
Correct $uri when ['prefix' => ''] and ['prefix' => '/'].
1 parent 1abdc59 commit ae73cf1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Application.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -911,16 +911,16 @@ public function addRoute($method, $uri, $action)
911911
{
912912
$action = $this->parseAction($action);
913913

914-
$uri = $uri === '/' ? $uri : '/'.trim($uri, '/');
915-
916914
if (isset($this->groupAttributes)) {
917915
if (isset($this->groupAttributes['prefix'])) {
918-
$uri = rtrim('/'.trim($this->groupAttributes['prefix'], '/').$uri, '/');
916+
$uri = trim($this->groupAttributes['prefix'], '/').'/'.trim($uri, '/');
919917
}
920918

921919
$action = $this->mergeGroupAttributes($action);
922920
}
923921

922+
$uri = '/'.trim($uri, '/');
923+
924924
if (isset($action['as'])) {
925925
$this->namedRoutes[$action['as']] = $uri;
926926
}

0 commit comments

Comments
 (0)
0