mirror of
https://github.com/danog/phpseclib.git
synced 2024-12-11 16:49:42 +01:00
Merge branch '1.0' into 2.0
This commit is contained in:
commit
bf03b0302b
@ -2217,7 +2217,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;
|
||||
@ -2227,7 +2227,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;
|
||||
@ -2274,6 +2274,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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user