From ebfbe99652c88574bf8fdb1de830df5e694cfda9 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Thu, 22 Aug 2024 12:04:31 +0200 Subject: fix(files): Create non-existent parents of mountpoints Signed-off-by: provokateurin --- lib/private/Files/View.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib') diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 0e5e433ccb6..09e2ba39c10 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1496,6 +1496,15 @@ class View { if ($pos = strpos($relativePath, '/')) { //mountpoint inside subfolder add size to the correct folder $entryName = substr($relativePath, 0, $pos); + + // Create parent folders if the mountpoint is inside a subfolder that doesn't exist yet + if (!isset($files[$entryName]) && $this->mkdir($path . '/' . $entryName) !== false) { + $info = $this->getFileInfo($path . '/' . $entryName); + if ($info !== false) { + $files[$entryName] = $info; + } + } + if (isset($files[$entryName])) { $files[$entryName]->addSubEntry($rootEntry, $mountPoint); } -- cgit v1.2.3