aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-04-08 15:42:10 +0200
committerRobin Appelman <robin@icewind.nl>2024-04-08 15:42:10 +0200
commit0a48e05e2743907c50c680bf952837d5bc060d88 (patch)
treeb4fe22c52702af95aee8b674b156faf617efa8b3
parent9b6551d4c8b62d10ad72c59d8cd9e69234cd76f0 (diff)
downloadnextcloud-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.php9
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));