[Pkg-owncloud-commits] [owncloud] 07/67: fix missing dir creation for file versions (OC_Filesystemview::mkdir doesn't work here because it doesn't create directories recursively)
David Prévot
taffit at alioth.debian.org
Fri Nov 8 23:10:30 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v4.5.1
in repository owncloud.
commit 550e774db2572f578e1c893af7eb2e156819842c
Author: Björn Schießle <schiessle at owncloud.com>
Date: Wed Oct 10 11:47:19 2012 +0200
fix missing dir creation for file versions (OC_Filesystemview::mkdir doesn't work here because it doesn't create directories recursively)
---
apps/files_versions/lib/hooks.php | 2 +-
apps/files_versions/lib/versions.php | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/apps/files_versions/lib/hooks.php b/apps/files_versions/lib/hooks.php
index 9ec0b01..500ce0e 100644
--- a/apps/files_versions/lib/hooks.php
+++ b/apps/files_versions/lib/hooks.php
@@ -64,7 +64,7 @@ class Hooks {
$abs_newpath = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('').$params['newpath'].'.v';
if(Storage::isversioned($rel_oldpath)) {
$info=pathinfo($abs_newpath);
- if(!file_exists($info['dirname'])) mkdir($info['dirname'],0700,true);
+ if(!file_exists($info['dirname'])) mkdir($info['dirname'],0750,true);
$versions = Storage::getVersions($rel_oldpath);
foreach ($versions as $v) {
rename($abs_oldpath.$v['version'], $abs_newpath.$v['version']);
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index 7d12e58..b68fa28 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -106,9 +106,9 @@ class Storage {
// create all parent folders
- $dirname = dirname($filename);
- if(!$users_view->file_exists('/files_versions/'.$dirname)) {
- $users_view->mkdir('/files_versions/'.$dirname,0700,true);
+ $info=pathinfo($filename);
+ if(!file_exists($versionsFolderName.'/'.$info['dirname'])) {
+ mkdir($versionsFolderName.'/'.$info['dirname'],0750,true);
}
// store a new version of a file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list