1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-11-30 04:39:21 +01:00

SFTP: fix put() with php://input as source

This commit is contained in:
terrafrost 2017-05-07 13:25:43 -05:00
parent 7fd1eefd66
commit 35a1102c0b

View File

@ -1973,7 +1973,14 @@ class Net_SFTP extends Net_SSH2
break;
case is_resource($data):
$mode = $mode & ~NET_SFTP_LOCAL_FILE;
$fp = $data;
$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;
}
break;
case $mode & NET_SFTP_LOCAL_FILE:
if (!is_file($data)) {