We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84c7dc1 commit d836360Copy full SHA for d836360
src/Tqdev/PhpCrudApi/Middleware/Router/SimpleRouter.php
@@ -41,12 +41,13 @@ private function detectBasePath(string $basePath): string
41
if ($basePath) {
42
return $basePath;
43
}
44
- if (isset($_SERVER['PATH_INFO'])) {
45
- $fullPath = explode('?', $_SERVER['REQUEST_URI'])[0];
46
- $path = $_SERVER['PATH_INFO'];
47
- if (substr($fullPath, -1 * strlen($path)) == $path) {
48
- return substr($fullPath, 0, -1 * strlen($path));
49
- }
+ $fullPath = explode('?', $_SERVER['REQUEST_URI'])[0];
+ $path = $_SERVER['PATH_INFO'];
+ if (!$path) {
+ return $fullPath;
+ }
+ if (substr($fullPath, -1 * strlen($path)) == $path) {
50
+ return substr($fullPath, 0, -1 * strlen($path));
51
52
return $_SERVER['PHP_SELF'];
53
0 commit comments