Parcourir la source

Update:fixed pathinfo bug

Zhu Jinhui il y a 7 ans
Parent
commit
64008101fb
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      src/Request/Url.php

+ 2 - 1
src/Request/Url.php

@@ -40,7 +40,8 @@ class Url
      */
     public static function getPathInfo()
     {
-        return PATH_INFO ? PATH_INFO : explode('?', $_SERVER['REQUEST_URI'])[0];
+		$pathinfo = str_replace(pathinfo($_SERVER['PHP_SELF'], PATHINFO_DIRNAME), '', $_SERVER['REQUEST_URI']);
+        return PATH_INFO ? PATH_INFO : explode('?', $pathinfo)[0];
     }
 
     /**