Skip to content

Commit 8c2095b

Browse files
committed
Bug fixed about Route path.
1 parent bfe9b54 commit 8c2095b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Router.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,9 @@ public function run()
396396
{
397397
$base = str_replace('\\', '/', str_replace($this->documentRoot, '', $this->runningPath));
398398
$uri = rtrim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/');
399-
$uri = str_replace(dirname($_SERVER['PHP_SELF']), '', $uri);
399+
if ($_SERVER['REQUEST_URI'] !== $_SERVER['PHP_SELF']) {
400+
$uri = str_replace(dirname($_SERVER['PHP_SELF']), '', $uri);
401+
}
400402

401403
if (($base !== $uri) && (substr($uri, -1) === '/')) {
402404
$uri = substr($uri, 0, (strlen($uri) - 1));

0 commit comments

Comments
 (0)