From 797351cd635177af249c65fdee8d541371592dba Mon Sep 17 00:00:00 2001 From: Alexander Vlasov Date: Thu, 22 Dec 2022 12:29:59 +0100 Subject: [PATCH] Fix undefined properties deprecated in PHP 8.2 --- phpseclib/Net/SFTP.php | 32 ++++++++++++++++++++++++++++++++ phpseclib/Net/SSH1.php | 16 ++++++++++++++-- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 9c6f8281..08028da9 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -359,6 +359,38 @@ class Net_SFTP extends Net_SSH2 */ var $partial_init = false; + /** + * http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-7.1 + * the order, in this case, matters quite a lot - see \phpseclib3\Net\SFTP::_parseAttributes() to understand why + * + * @var array + * @access private + */ + var $attributes = array(); + + /** + * @var array + * @access private + */ + var $open_flags = array(); + + /** + * SFTPv5+ changed the flags up: + * https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-13#section-8.1.1.3 + * + * @var array + * @access private + */ + var $open_flags5 = array(); + + /** + * http://tools.ietf.org/html/draft-ietf-secsh-filexfer-04#section-5.2 + * see \phpseclib\Net\SFTP::_parseLongname() for an explanation + * + * @var array + */ + var $file_types = array(); + /** * Default Constructor. * diff --git a/phpseclib/Net/SSH1.php b/phpseclib/Net/SSH1.php index 76401a00..bb1bb06c 100644 --- a/phpseclib/Net/SSH1.php +++ b/phpseclib/Net/SSH1.php @@ -371,7 +371,7 @@ class Net_SSH1 * @var array * @access private */ - var $protocol_flag_log = array(); + var $protocol_flags_log = array(); /** * Message Log @@ -418,6 +418,18 @@ class Net_SSH1 */ var $interactiveBuffer = ''; + /** + * Current log size + * + * Should never exceed self::LOG_MAX_SIZE + * + * @see self::_send_binary_packet() + * @see self::_get_binary_packet() + * @var int + * @access private + */ + var $log_size; + /** * Timeout * @@ -1467,7 +1479,7 @@ class Net_SSH1 switch (NET_SSH1_LOGGING) { case NET_SSH1_LOG_SIMPLE: - return $this->message_number_log; + return $this->protocol_flags_log; break; case NET_SSH1_LOG_COMPLEX: return $this->_format_log($this->message_log, $this->protocol_flags_log);