Skip to content

Commit 0e892db

Browse files
AnnoyingTechnologymatthiasmullie
authored andcommitted
Intercept openbasedir exceptions when detecting check for files
1 parent ea59f29 commit 0e892db

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Minify.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,13 @@ protected function canImportFile($path)
501501
return false;
502502
}
503503

504-
return strlen($path) < PHP_MAXPATHLEN && @is_file($path) && is_readable($path);
504+
try {
505+
return strlen($path) < PHP_MAXPATHLEN && @is_file($path) && is_readable($path);
506+
}
507+
// catch openbasedir exceptions which are not caught by @ on is_file()
508+
catch(\Exception $e) {
509+
return false;
510+
}
505511
}
506512

507513
/**

0 commit comments

Comments
 (0)