From 557b3c468b75e942305a418212fc35ebedbcd382 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 18 Sep 2024 12:29:13 +0200 Subject: [PATCH] fix: verify that parent exists in cache when inserting Signed-off-by: Robin Appelman --- lib/private/Files/Cache/Cache.php | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.39.5