summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-08-14 17:58:41 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-08-14 17:58:41 +0200
commitd314729ceaf26a373af8a43ca74e20393e6159dc (patch)
tree442d1868edcbe0e104fea1a7a6c5ad7096dd0da0 /apps/files_versions
parent435e63b5eef345a996618dbc0f4e4c9d202de7ec (diff)
downloadnextcloud-server-d314729ceaf26a373af8a43ca74e20393e6159dc.tar.gz
nextcloud-server-d314729ceaf26a373af8a43ca74e20393e6159dc.zip
use OC files API to create missing directory which should handle special chars in every environment correctly
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/lib/versions.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index 70b8f30be5c..b0fde6b559f 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);