mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-27 11:52:48 +00:00
SFTP: fix put() with php://input as source
This commit is contained in:
parent
7fd1eefd66
commit
35a1102c0b
@ -1973,7 +1973,14 @@ class Net_SFTP extends Net_SSH2
|
|||||||
break;
|
break;
|
||||||
case is_resource($data):
|
case is_resource($data):
|
||||||
$mode = $mode & ~NET_SFTP_LOCAL_FILE;
|
$mode = $mode & ~NET_SFTP_LOCAL_FILE;
|
||||||
|
$info = stream_get_meta_data($data);
|
||||||
|
if ($info['wrapper_type'] == 'PHP' && $info['stream_type'] == 'Input') {
|
||||||
|
$fp = fopen('php://memory', 'w+');
|
||||||
|
stream_copy_to_stream($data, $fp);
|
||||||
|
rewind($fp);
|
||||||
|
} else {
|
||||||
$fp = $data;
|
$fp = $data;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case $mode & NET_SFTP_LOCAL_FILE:
|
case $mode & NET_SFTP_LOCAL_FILE:
|
||||||
if (!is_file($data)) {
|
if (!is_file($data)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user