summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2012-11-05 13:48:17 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2012-11-05 13:48:17 -0800
commitf2d5450e141ab37b89b209bd7aab29a97bb343f9 (patch)
treed55c610588b32f1d3f3ad2f6decfcd80814405e5
parent3a4fc7c5b6bbd675620450a0b57c747987285afb (diff)
parent8b3ae4309b1a4c44d6a8cccd17534e42f2f17a59 (diff)
downloadnextcloud-server-f2d5450e141ab37b89b209bd7aab29a97bb343f9.tar.gz
nextcloud-server-f2d5450e141ab37b89b209bd7aab29a97bb343f9.zip
Merge pull request #269 from owncloud/fix_fe_mkdir_warning
Fix mkdir and opendir warnings when path does not exist
-rwxr-xr-xapps/files_external/lib/config.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 57a6438ff10..fdc847fcf2c 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) {