From b66b5dc6b2f1c5c65d6b3e8f14f9f5fdf0c6556d Mon Sep 17 00:00:00 2001 From: terrafrost Date: Fri, 22 Nov 2024 18:00:43 -0600 Subject: [PATCH] SSH2: replace user_error with Exceptions --- phpseclib/Net/SSH2.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index c4970d49..66001f18 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -3730,18 +3730,18 @@ class SSH2 $cmf = ord($payload[0]); $cm = $cmf & 0x0F; if ($cm != 8) { // deflate - user_error("Only CM = 8 ('deflate') is supported ($cm)"); + throw new \RuntimeException("Only CM = 8 ('deflate') is supported ($cm)"); } $cinfo = ($cmf & 0xF0) >> 4; if ($cinfo > 7) { - user_error("CINFO above 7 is not allowed ($cinfo)"); + throw new \RuntimeException("CINFO above 7 is not allowed ($cinfo)"); } $windowSize = 1 << ($cinfo + 8); $flg = ord($payload[1]); //$fcheck = $flg && 0x0F; if ((($cmf << 8) | $flg) % 31) { - user_error('fcheck failed'); + throw new \RuntimeException('fcheck failed'); } $fdict = boolval($flg & 0x20); $flevel = ($flg & 0xC0) >> 6;