Detect if stream metadata has wrapper_type set for SFTP put() method

This commit is contained in:
Yan Hu 2022-05-10 10:31:27 +08:00 committed by terrafrost
parent 1dfd1b9cd4
commit eb71a6da75

View File

@ -2328,7 +2328,7 @@ class Net_SFTP extends Net_SSH2
case is_resource($data):
$mode = $mode & ~NET_SFTP_LOCAL_FILE;
$info = stream_get_meta_data($data);
if ($info['wrapper_type'] == 'PHP' && $info['stream_type'] == 'Input') {
if (isset($info['wrapper_type']) && $info['wrapper_type'] == 'PHP' && $info['stream_type'] == 'Input') {
$fp = fopen('php://memory', 'w+');
stream_copy_to_stream($data, $fp);
rewind($fp);