From: Robin Appelman Date: Wed, 18 Sep 2024 10:29:13 +0000 (+0200) Subject: fix: verify that parent exists in cache when inserting X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=557b3c468b75e942305a418212fc35ebedbcd382;p=nextcloud-server.git fix: verify that parent exists in cache when inserting Signed-off-by: Robin Appelman --- diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 876f17ff740..c3451326d6f 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -265,6 +265,9 @@ class Cache implements ICache { if (!isset($data['parent'])) { $data['parent'] = $this->getParentId($file); } + if ($data['parent'] === -1 && $file !== '') { + throw new \Exception('Parent folder not in filecache for ' . $file); + } $data['name'] = basename($file); [$values, $extensionValues] = $this->normalizeData($data);