diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 70b8f30be5cdf232c1c93b4595d5b79bcb7b3930..b0fde6b559fa72bd35d482efb5f805121d948014 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -110,10 +110,13 @@ class Storage { } // create all parent folders - $info=pathinfo($filename); - $versionsFolderName=$versions_view->getLocalFolder(''); - if(!file_exists($versionsFolderName.'/'.$info['dirname'])) { - mkdir($versionsFolderName.'/'.$info['dirname'], 0750, true); + $dirname= \OC_Filesystem::normalizePath(pathinfo($filename, PATHINFO_DIRNAME)); + $dirParts = explode('/', $dirname); + foreach ($dirParts as $part) { + $dir = $dir.'/'.$part; + if(!$versions_view->file_exists($dir)) { + $versions_view->mkdir($dir); + } } $versionsSize = self::getVersionsSize($uid);