diff options
-rw-r--r-- | lib/private/Files/Storage/Local.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php index 813e5aa09d7..24ded5fb317 100644 --- a/lib/private/Files/Storage/Local.php +++ b/lib/private/Files/Storage/Local.php @@ -276,6 +276,15 @@ class Local extends \OC\Files\Storage\Common { if ($this->caseInsensitive) { $fullPath = $this->getSourcePath($path); $content = scandir(dirname($fullPath), SCANDIR_SORT_NONE); + $parentPath = dirname($fullPath); + if (!is_dir($parentPath)) { + /** @var LoggerInterface $logger */ + $logger = \OC::$server->get(LoggerInterface::class); + $logger->warning("called file_exists with non existing parent: " . $path, [ + 'exception' => new \Exception("called file_exists with non existing parent: " . $path) + ]); + return false; + } return is_array($content) && array_search(basename($fullPath), $content) !== false; } else { return file_exists($this->getSourcePath($path)); |