]> source.dussan.org Git - nextcloud-server.git/commitdiff
use OC files API to create missing directory which should handle special chars in...
authorBjoern Schiessle <schiessle@owncloud.com>
Wed, 14 Aug 2013 15:58:41 +0000 (17:58 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Sat, 17 Aug 2013 15:35:39 +0000 (17:35 +0200)
apps/files_versions/lib/versions.php

index 11109f00d0a45bc7414d734ac41c1e7acd68f361..78971b6d90e6b0eff375f013e342f3939644b257 100644 (file)
@@ -109,10 +109,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);