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 4032e27 commit fa6002bCopy full SHA for fa6002b
src/PhpDebugBarMiddleware.php
@@ -83,13 +83,19 @@ private function getStaticFile(UriInterface $uri)
83
return;
84
}
85
86
- $pathToFile = substr($uri->getPath(), strlen($this->debugBarRenderer->getBaseUrl()));
+ if (empty($uri->getBasePath())) {
87
+ return;
88
+ }
89
+
90
+ $path = $uri->getBasePath() ?: $uri->getPath();
91
+ $pathToFile = substr($path, strlen($this->debugBarRenderer->getBaseUrl()));
92
93
$fullPathToFile = $this->debugBarRenderer->getBasePath() . $pathToFile;
94
95
if (!file_exists($fullPathToFile)) {
96
97
98
+ $fullPathToFile = str_replace('/', DIRECTORY_SEPARATOR, $fullPathToFile);
99
100
$stream = new Stream($fullPathToFile, 'r');
101
$staticResponse = new Response($stream);
0 commit comments