Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: avoid scanning a non existing directory
Signed-off-by: Benjamin Gaussorgues <[email protected]>
  • Loading branch information
Altahrim authored and backportbot[bot] committed Mar 14, 2024
commit e13e8c13491491f66eb9a4eb5c489672b5cafc44
6 changes: 5 additions & 1 deletion lib/private/Files/Storage/Local.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,11 @@ public function isUpdatable($path) {
public function file_exists($path) {
if ($this->caseInsensitive) {
$fullPath = $this->getSourcePath($path);
$content = scandir(dirname($fullPath), SCANDIR_SORT_NONE);
$parentPath = dirname($fullPath);
if (!is_dir($parentPath)) {
return false;
}
$content = scandir($parentPath, SCANDIR_SORT_NONE);
return is_array($content) && array_search(basename($fullPath), $content) !== false;
} else {
return file_exists($this->getSourcePath($path));
Expand Down