Merge branch '3.0'

This commit is contained in:
terrafrost 2020-11-26 19:11:40 -06:00
commit 6e2960e304

View File

@ -2128,7 +2128,7 @@ class SFTP extends SSH2
$res_offset = $stat['size'];
} else {
$res_offset = 0;
if ($local_file !== false) {
if ($local_file !== false && !is_callable($local_file) ) {
$fp = fopen($local_file, 'wb');
if (!$fp) {
return false;
@ -2138,7 +2138,7 @@ class SFTP extends SSH2
}
}
$fclose_check = $local_file !== false && !is_resource($local_file);
$fclose_check = $local_file !== false && !is_callable($local_file) && !is_resource($local_file);
$start = $offset;
$read = 0;
@ -2185,6 +2185,8 @@ class SFTP extends SSH2
$offset+= strlen($temp);
if ($local_file === false) {
$content.= $temp;
} elseif (is_callable($local_file)) {
$local_file($temp);
} else {
fputs($fp, $temp);
}