aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-09-18 12:29:13 +0200
committerRobin Appelman <robin@icewind.nl>2024-09-18 14:11:27 +0200
commit75cf17e4c4ce3ab6e1d5733eb5fe6e710e2f7286 (patch)
tree5b6204a76962c3bda4004ea278115d8d0d0fe729 /lib
parente0fb25f846966b93929f4661cb51881fcdedad68 (diff)
downloadnextcloud-server-75cf17e4c4ce3ab6e1d5733eb5fe6e710e2f7286.tar.gz
nextcloud-server-75cf17e4c4ce3ab6e1d5733eb5fe6e710e2f7286.zip
fix: verify that parent exists in cache when inserting
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/Cache.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php
index e1547fefe1c..de66e8924a5 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);