From 5f4c89b688a3961c541de378c7b566e500969aca Mon Sep 17 00:00:00 2001 From: Jack Worman Date: Fri, 22 Jul 2022 21:16:51 -0500 Subject: [PATCH] Re-add_old_x --- build/psalm_baseline.xml | 70 +++++++++++++++------------------------- phpseclib/File/ANSI.php | 11 +++++++ 2 files changed, 37 insertions(+), 44 deletions(-) diff --git a/build/psalm_baseline.xml b/build/psalm_baseline.xml index 9fc0cd61..f012cc1a 100644 --- a/build/psalm_baseline.xml +++ b/build/psalm_baseline.xml @@ -1,5 +1,5 @@ - + $var @@ -2048,7 +2048,7 @@ [static::OID_NAME => static::OID_VALUE] - + $algorithm $encryptionAlgorithm $encryptionScheme @@ -2057,6 +2057,7 @@ $key $key $key['privateKeyAlgorithm']['parameters'] + $key['publicKeyAlgorithm']['parameters'] $meta['meta']['algorithm'] $meta['meta']['cipher'] $meta['meta']['keyDerivationFunc'] @@ -7808,7 +7809,7 @@ $t - RSA + PrivateKey $primes[$i] @@ -9965,10 +9966,14 @@ $this->x $this->x + 1 - + $match[2] - 1 $this->x $this->x + $this->x + $this->x + $this->x + $this->x $this->x += $match[1] $this->x -= $match[1] @@ -9987,7 +9992,7 @@ \phpseclib3\File\ANSI - + $ansi $attr_row $attrs @@ -9996,6 +10001,7 @@ $max_history $max_x $max_y + $old_x $old_y $screen $tokenization @@ -10009,6 +10015,9 @@ $this->screen $this->screen + + $old_x + @@ -14441,7 +14450,7 @@ readlink realpath - + $a['filename'] $attr['mode'] $b['filename'] @@ -14475,7 +14484,6 @@ $fp $fp $length - $length + $res_offset $link $link $link @@ -14492,8 +14500,6 @@ $remote_file $remote_file $stat['atime'] - $stat['atime'] - $stat['mtime'] $stat['mtime'] $status $status @@ -14539,7 +14545,7 @@ $this->requestBuffer[$packet_id] $this->requestBuffer[$request_id] - + $a[$sort] $attr $attr @@ -14576,7 +14582,6 @@ $props $remote_file $remote_file - $res_offset $response $response $response @@ -14588,9 +14593,6 @@ $result $result $size - $size - $size - $size $subtemp $temp $temp @@ -14619,7 +14621,7 @@ string string|bool - + $a[$sort] $a[$sort] $attr @@ -14636,11 +14638,8 @@ $key $length $offset - $res_offset $shortname $shortname - $size - $size $start $subtemp $temp @@ -14737,7 +14736,7 @@ $this->channel_status[self::CHANNEL] $this->server_channels[self::CHANNEL] - + $a['filename'] $a['filename'] $a['filename'] @@ -14749,13 +14748,7 @@ $b['filename'] $b['filename'] $stat['atime'] - $stat['atime'] - $stat['atime'] $stat['mtime'] - $stat['mtime'] - $stat['mtime'] - $stat['size'] - $stat['size'] $stat['type'] $this->stat($remote_file)['size'] @@ -17114,8 +17107,7 @@ $args - - $key + $r['primes'] $r['primes'] $rsa->getPublicKey()->toString('PKCS1') @@ -17124,21 +17116,19 @@ $privatekey $publickey - + $actual $ciphertext - $key $plaintext $prime $signature [$publickey, $privatekey] - + decrypt encrypt getLength toString - toString $r['primes'] @@ -17149,13 +17139,10 @@ CreateKeyTest CreateKeyTest - - getPublicKey - getPublicKey + getPublicKey sign verify - withPassword CreateKeyTest @@ -17609,11 +17596,10 @@ 'phpseclib3\Math\BigInteger' - $privateKey - - - $authority->sign($issuer, $subject) $publicKey + + + $authority->sign($issuer, $subject) $result $subjectKey @@ -17628,11 +17614,10 @@ $extension['extnValue'] $loader->loadX509($cert)['tbsCertificate'] - + $customExtensionDecodedData $decodedData $extension - $publicKey $result $subjectKey @@ -17651,9 +17636,6 @@ X509ExtensionTest X509ExtensionTest - - getPublicKey - X509ExtensionTest diff --git a/phpseclib/File/ANSI.php b/phpseclib/File/ANSI.php index 9ca32810..78327fac 100644 --- a/phpseclib/File/ANSI.php +++ b/phpseclib/File/ANSI.php @@ -76,6 +76,13 @@ class ANSI */ private $y; + /** + * Old Column + * + * @var int + */ + private $old_x; + /** * Old Row * @@ -214,6 +221,7 @@ class ANSI // http://ascii-table.com/ansi-escape-sequences-vt-100.php switch ($this->ansi) { case "\x1B[H": // Move cursor to upper left corner + $this->old_x = $this->x; $this->old_y = $this->y; $this->x = $this->y = 0; break; @@ -253,14 +261,17 @@ class ANSI $this->y += (int) $match[1]; break; case preg_match('#\x1B\[(\d+);(\d+)H#', $this->ansi, $match): // Move cursor to screen location v,h + $this->old_x = $this->x; $this->old_y = $this->y; $this->x = $match[2] - 1; $this->y = (int) $match[1] - 1; break; case preg_match('#\x1B\[(\d+)C#', $this->ansi, $match): // Move cursor right n lines + $this->old_x = $this->x; $this->x += $match[1]; break; case preg_match('#\x1B\[(\d+)D#', $this->ansi, $match): // Move cursor left n lines + $this->old_x = $this->x; $this->x -= $match[1]; if ($this->x < 0) { $this->x = 0;