fix An error happened (ErrorException): Argument 4 passed to EGroupware\Api\Vfs::copy_files() must be of the type array, none given

This commit is contained in:
Ralf Becker 2016-03-29 11:01:34 +00:00
parent 7a77706878
commit 58834a0c73
2 changed files with 6 additions and 3 deletions

View File

@ -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))
{

View File

@ -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);