forked from extern/egroupware
always return resource seeked to its start
This commit is contained in:
parent
b08f90d930
commit
08609c1e0b
@ -2091,7 +2091,7 @@ class Vfs extends Vfs\StreamWrapper
|
|||||||
if (is_resource($tmp_name))
|
if (is_resource($tmp_name))
|
||||||
{
|
{
|
||||||
$ret = ($dest = egw_vfs::fopen($target, 'w')) &&
|
$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($dest) && self::stat($target);
|
||||||
|
|
||||||
fclose($tmp_name);
|
fclose($tmp_name);
|
||||||
|
@ -1596,6 +1596,8 @@ class egw_link extends solink
|
|||||||
}
|
}
|
||||||
$ret = call_user_func_array('ExecMethod2', $data);
|
$ret = call_user_func_array('ExecMethod2', $data);
|
||||||
|
|
||||||
|
if (is_resource($ret)) fseek($ret, 0);
|
||||||
|
|
||||||
if ($return_resource != is_resource($ret))
|
if ($return_resource != is_resource($ret))
|
||||||
{
|
{
|
||||||
if ($return_resource && ($fp = fopen('php://temp', 'w')))
|
if ($return_resource && ($fp = fopen('php://temp', 'w')))
|
||||||
@ -1608,7 +1610,6 @@ class egw_link extends solink
|
|||||||
{
|
{
|
||||||
$fp = $ret;
|
$fp = $ret;
|
||||||
$ret = '';
|
$ret = '';
|
||||||
fseek($fp, 0);
|
|
||||||
while(!feof($fp))
|
while(!feof($fp))
|
||||||
{
|
{
|
||||||
$ret .= fread($fp, 8192);
|
$ret .= fread($fp, 8192);
|
||||||
|
Loading…
Reference in New Issue
Block a user