diff options
author | Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> | 2024-03-14 16:26:52 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-03-14 18:47:14 +0000 |
commit | e13e8c13491491f66eb9a4eb5c489672b5cafc44 (patch) | |
tree | 087516c5426a171b6dd6ed6c77bbf2af599dba22 /lib | |
parent | cd9c0b1c438f94349fc0e5270376175331309a1f (diff) | |
download | nextcloud-server-e13e8c13491491f66eb9a4eb5c489672b5cafc44.tar.gz nextcloud-server-e13e8c13491491f66eb9a4eb5c489672b5cafc44.zip |
fix: avoid scanning a non existing directory
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Storage/Local.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php index 0fca853da59..c49cf91dc91 100644 --- a/lib/private/Files/Storage/Local.php +++ b/lib/private/Files/Storage/Local.php @@ -282,7 +282,11 @@ class Local extends \OC\Files\Storage\Common { 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)); |