always return resource seeked to its start

This commit is contained in:
Ralf Becker 2015-04-14 17:05:38 +00:00
parent b08f90d930
commit 08609c1e0b
2 changed files with 3 additions and 2 deletions

View File

@ -2091,7 +2091,7 @@ class Vfs extends Vfs\StreamWrapper
if (is_resource($tmp_name))
{
$ret = ($dest = egw_vfs::fopen($target, 'w')) &&
stream_copy_to_stream($tmp_name, $dest) &&
stream_copy_to_stream($tmp_name, $dest) !== false &&
fclose($dest) && self::stat($target);
fclose($tmp_name);

View File

@ -1596,6 +1596,8 @@ class egw_link extends solink
}
$ret = call_user_func_array('ExecMethod2', $data);
if (is_resource($ret)) fseek($ret, 0);
if ($return_resource != is_resource($ret))
{
if ($return_resource && ($fp = fopen('php://temp', 'w')))
@ -1608,7 +1610,6 @@ class egw_link extends solink
{
$fp = $ret;
$ret = '';
fseek($fp, 0);
while(!feof($fp))
{
$ret .= fread($fp, 8192);