diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 3dd2ac7c..e450268f 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -144,6 +144,10 @@ class SSH2 * Returns when a string matching the regular expression $expect is found */ const READ_REGEX = 2; + /** + * Returns when a string matching the regular expression $expect is found + */ + const READ_NEXT = 3; /** * Make sure that the log never gets larger than this */ @@ -2828,6 +2832,10 @@ class SSH2 $channel = $this->get_interactive_channel(); + if ($mode == self::READ_NEXT) { + return $this->_get_channel_packet($channel); + } + $match = $expect; while (true) { if ($mode == self::READ_REGEX) {