mirror of
https://github.com/laravel/valet.git
synced 2026-02-06 00:40:06 +01:00
Checks to see if file_exists *and* it's an actual file.
The current check short-circuits too early, allowing the existence of a folder at $uri to trigger a false positive. This verifies that the file at $uri is actually a file before returning.
This commit is contained in:
committed by
GitHub
parent
995f2d8457
commit
9f70e8163f
@@ -26,7 +26,8 @@ public function serves($sitePath, $siteName, $uri)
|
|||||||
*/
|
*/
|
||||||
public function isStaticFile($sitePath, $siteName, $uri)
|
public function isStaticFile($sitePath, $siteName, $uri)
|
||||||
{
|
{
|
||||||
if (file_exists($staticFilePath = $sitePath.'/public'.$uri)) {
|
if (file_exists($staticFilePath = $sitePath.'/public'.$uri)
|
||||||
|
&& is_file($staticFilePath)) {
|
||||||
return $staticFilePath;
|
return $staticFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user