aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/View.php
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-08-22 12:04:31 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-09-04 18:01:36 +0000
commite77ac5c8e12f3f67cbda58908d9d9b2ff68ad655 (patch)
treecd6001f66e64ee4a3d2eac1d0a13a0bab325078d /lib/private/Files/View.php
parent4ac730e463cb01821f405274c314e8782dbbe58a (diff)
downloadnextcloud-server-e77ac5c8e12f3f67cbda58908d9d9b2ff68ad655.tar.gz
nextcloud-server-e77ac5c8e12f3f67cbda58908d9d9b2ff68ad655.zip
fix(files): Create non-existent parents of mountpoints
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'lib/private/Files/View.php')
-rw-r--r--lib/private/Files/View.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index 4aaea23e7f1..a4a68b2f4a7 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -1527,6 +1527,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);
}