diff options
author | Robin Appelman <robin@icewind.nl> | 2024-04-08 15:42:10 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2024-04-08 15:42:10 +0200 |
commit | 0a48e05e2743907c50c680bf952837d5bc060d88 (patch) | |
tree | b4fe22c52702af95aee8b674b156faf617efa8b3 | |
parent | 9b6551d4c8b62d10ad72c59d8cd9e69234cd76f0 (diff) | |
download | nextcloud-server-debug-file-exists-backtrace.tar.gz nextcloud-server-debug-file-exists-backtrace.zip |
debug: log backtrace when file_exists parent doesn't existdebug-file-exists-backtrace
Signed-off-by: Robin Appelman <robin@icewind.nl>
-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)); |