Skip to content

Commit 13a99fa

Browse files
committed
Fix directory check in sitePath method
Using is_dir() on a parent directory can trigger errors when PHP does not have permission to access it, which can happen when open_basedir is used.
1 parent e3902e7 commit 13a99fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cli/Valet/Server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public function sitePath(string $siteName): ?string
173173
$dirs = [];
174174

175175
while (($file = readdir($handle)) !== false) {
176-
if (is_dir($path.'/'.$file) && ! in_array($file, ['.', '..'])) {
176+
if (! in_array($file, ['.', '..']) && is_dir($path.'/'.$file)) {
177177
$dirs[] = $file;
178178
}
179179
}

0 commit comments

Comments
 (0)