From 871f37087da3d6f6e0a912f56733e6eda42d58f7 Mon Sep 17 00:00:00 2001 From: walkonthemarz Date: Fri, 12 Aug 2022 16:25:36 +0800 Subject: [PATCH] Revert back the commit https://github.com/phpseclib/phpseclib/commit/85205bf6d5ea62249ed31585e31c39ed16747714 --- phpseclib/Net/SFTP.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index ec84cba3..2f38e7d8 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -3315,7 +3315,10 @@ class SFTP extends SSH2 // SFTP packet type and data payload while ($tempLength > 0) { $temp = $this->get_channel_packet(self::CHANNEL, true); - if (is_bool($temp)) { + if ($temp === true) { + if ($this->channel_status[self::CHANNEL] === NET_SSH2_MSG_CHANNEL_CLOSE) { + $this->channel_close = true; + } $this->packet_type = false; $this->packet_buffer = ''; return false;