Skip to content

Commit 0bfa41d

Browse files
committed
fix getUriArray
1 parent bc74476 commit 0bfa41d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Router.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,12 @@ private function getUriArray(string $uri): array
361361
if ($array[0] === '') { // If first segment is empty
362362
array_shift($array); // trim off first segment
363363
}
364+
364365
if (count($array) <= 1) { // If array has 1 or less segments
365366
return $array;
366367
}
367368
if ($array[count($array)-1] === '') { // If last segment is empty
368-
array_reverse($array);
369-
array_shift($array); // trim off last segment
369+
array_pop($array); // trim off last segment
370370
}
371371

372372
return $array;

0 commit comments

Comments
 (0)