mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-27 08:19:09 +01:00
fixed attachments lost when converting email to infolog, is_uploaded_file check in egw_vfs::copy_uploaded need to be switched off (plus improved logging)
This commit is contained in:
parent
05a3ccb320
commit
5e05030629
@ -941,6 +941,8 @@ class egw_link extends solink
|
||||
/**
|
||||
* Put a file to the corrosponding place in the VFS and set the attributes
|
||||
*
|
||||
* Does NO is_uploaded_file check, calling application is responsible for doing that for uploaded files!
|
||||
*
|
||||
* @param string $app appname to linke the file to
|
||||
* @param string $id id in $app
|
||||
* @param array $file informations about the file in format of the etemplate file-type
|
||||
@ -961,8 +963,8 @@ class egw_link extends solink
|
||||
}
|
||||
if (file_exists($entry_dir) || ($Ok = mkdir($entry_dir,0,true)))
|
||||
{
|
||||
$Ok = egw_vfs::copy_uploaded($file, $p=self::vfs_path($app,$id,'',true), $comment);
|
||||
error_log(__METHOD__."('$app', '$id', ".array2string($file).", '$comment') called egw_vfs::copy('$file[tmp_name]', '$p')=".array2string($Ok));
|
||||
$Ok = egw_vfs::copy_uploaded($file, $p=self::vfs_path($app,$id,'',true), $comment, false); // no is_uploaded_file() check!
|
||||
if (!$Ok) error_log(__METHOD__."('$app', '$id', ".array2string($file).", '$comment') called egw_vfs::copy_uploaded('$file[tmp_name]', '$p', '$comment', false)=".array2string($Ok));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1710,10 +1710,14 @@ class egw_vfs extends vfs_stream_wrapper
|
||||
{
|
||||
$target = self::concat($target, self::encodePathComponent(is_array($src) ? $src['name'] : basename($tmp_name)));
|
||||
}
|
||||
if ($check_is_uploaded_file && !is_uploaded_file($tmp_name) ||
|
||||
!(self::is_writable($target) || self::is_writable(self::dirname($target))))
|
||||
if ($check_is_uploaded_file && !is_uploaded_file($tmp_name))
|
||||
{
|
||||
if (self::LOG_LEVEL) error_log(__METHOD__."($tmp_name, $target, ".array2string($props).") returning false");
|
||||
if (self::LOG_LEVEL) error_log(__METHOD__."($tmp_name, $target, ".array2string($props).",$check_is_uploaded_file) returning FALSE !is_uploaded_file()");
|
||||
return false;
|
||||
}
|
||||
if (!(self::is_writable($target) || self::is_writable(self::dirname($target))))
|
||||
{
|
||||
if (self::LOG_LEVEL) error_log(__METHOD__."($tmp_name, $target, ".array2string($props).",$check_is_uploaded_file) returning FALSE !writable");
|
||||
return false;
|
||||
}
|
||||
if ($props)
|
||||
@ -1744,7 +1748,7 @@ class egw_vfs extends vfs_stream_wrapper
|
||||
self::proppatch($target, $props);
|
||||
}
|
||||
$ret = copy($tmp_name,self::PREFIX.$target) ? self::stat($target) : false;
|
||||
if (self::LOG_LEVEL > 1) error_log(__METHOD__."($tmp_name, $target, ".array2string($props).") returning ".array2string($ret));
|
||||
if (self::LOG_LEVEL > 1 || !$ret && self::LOG_LEVEL) error_log(__METHOD__."($tmp_name, $target, ".array2string($props).") returning ".array2string($ret));
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user