]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix mkdir and opendir warnings when path does not exist
authorArthur Schiwon <blizzz@owncloud.com>
Mon, 5 Nov 2012 20:37:59 +0000 (21:37 +0100)
committerArthur Schiwon <blizzz@owncloud.com>
Tue, 6 Nov 2012 12:21:52 +0000 (13:21 +0100)
apps/files_external/lib/config.php

index 0a576f06f1f6884f8e9279fdf4b869f633a7cc8b..d87cf782141f9cf6ec76267178a8453eea6800b9 100755 (executable)
@@ -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) {