diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2024-09-05 10:55:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-05 10:55:12 +0200 |
commit | 4dfc5f69b020f065d88aa016bfaf55dbb00dba7c (patch) | |
tree | 3eea576a0bd9ea2553d3b16bb0bcd506abf7720d /lib | |
parent | f99f750eff47b368d5c97e22cb8e5cafe345cb85 (diff) | |
parent | e77ac5c8e12f3f67cbda58908d9d9b2ff68ad655 (diff) | |
download | nextcloud-server-4dfc5f69b020f065d88aa016bfaf55dbb00dba7c.tar.gz nextcloud-server-4dfc5f69b020f065d88aa016bfaf55dbb00dba7c.zip |
Merge pull request #47749 from nextcloud/backport/47417/stable28
[stable28] fix(files): Create non-existent parents of mountpoints
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/View.php | 9 |
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); } |