]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix: verify that parent exists in cache when inserting
authorRobin Appelman <robin@icewind.nl>
Wed, 18 Sep 2024 10:29:13 +0000 (12:29 +0200)
committerRobin Appelman <robin@icewind.nl>
Thu, 19 Sep 2024 09:01:41 +0000 (11:01 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Files/Cache/Cache.php

index 876f17ff7402a75a6f3fae0f2c5d2c7bfd8d1f53..c3451326d6f3e7d202b9786208a48b3668d564ee 100644 (file)
@@ -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);