diff --git a/api/src/Vfs.php b/api/src/Vfs.php index 36a18fdaba..298e73807d 100644 --- a/api/src/Vfs.php +++ b/api/src/Vfs.php @@ -1937,8 +1937,11 @@ class Vfs extends Vfs\StreamWrapper * * @param array $src contains the source file * @param string $dst is the destination directory + * @param int& $errs =null on return number of errors happened + * @param array& $copied =null on return files copied + * @return boolean true for no errors, false otherwise */ - static public function copy_files(array $src, $dst, &$errs, array &$copied) + static public function copy_files(array $src, $dst, &$errs=null, array &$copied=null) { if (self::is_dir($dst)) { diff --git a/api/src/Vfs/Sharing.php b/api/src/Vfs/Sharing.php index 621445a679..e55cd29ae9 100644 --- a/api/src/Vfs/Sharing.php +++ b/api/src/Vfs/Sharing.php @@ -460,7 +460,7 @@ class Sharing if ($mode == 'link') { $user_tmp = '/home/'.$GLOBALS['egw_info']['user']['account_lid'].'/.tmp'; - if (!Vfs::file_exists($user_tmp) && !Vfs::mkdir($user_tmp)) + if (!Vfs::file_exists($user_tmp) && !Vfs::mkdir($user_tmp, null, STREAM_MKDIR_RECURSIVE)) { throw new Api\Exception\AssertionFailed("Could NOT create temp. directory '$user_tmp'!"); } @@ -468,7 +468,7 @@ class Sharing do { $tmp_file = Vfs::concat($user_tmp, ($n?$n.'.':'').Vfs::basename($name)); } - while(!(is_dir($path) && Vfs::mkdir($tmp_file) || + while(!(is_dir($path) && Vfs::mkdir($tmp_file, null, STREAM_MKDIR_RECURSIVE) || !is_dir($path) && (!Vfs::file_exists($tmp_file) && ($fp = Vfs::fopen($tmp_file, 'x')) || // do not copy identical files again to users tmp dir, just re-use them Vfs::file_exists($tmp_file) && Vfs::compare(Vfs::PREFIX.$tmp_file, $path))) && $n++ < 100);