diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2012-11-06 00:37:59 +0400 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2012-11-06 16:21:52 +0400 |
commit | ba2bba0f66d20907e212a3853e85b9e26b14027e (patch) | |
tree | 27d9d13231d9aa9414cbe70feb7a199f67981ff5 /apps/files_external | |
parent | 3740ce28547f4ea4146593a9df50b196f77bb006 (diff) |
Fix mkdir and opendir warnings when path does not exist
Diffstat (limited to 'apps/files_external')
-rwxr-xr-x | apps/files_external/lib/config.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 0a576f06f1f..d87cf782141 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -285,7 +285,12 @@ class OC_Mount_Config { public static function getCertificates() { $view = \OCP\Files::getStorage('files_external'); $path=\OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath("").'uploads/'; - if (!is_dir($path)) mkdir($path); + \OCP\Util::writeLog('files_external', 'checking path '.$path, \OCP\Util::INFO); + if(!is_dir($path)) { + //path might not exist (e.g. non-standard OC_User::getHome() value) + //in this case create full path using 3rd (recursive=true) parameter. + mkdir($path, 0777, true); + } $result = array(); $handle = opendir($path); if (!$handle) { |