Re-add_old_x

This commit is contained in:
Jack Worman 2022-07-22 21:16:51 -05:00
parent a699dadb03
commit 5f4c89b688
2 changed files with 37 additions and 44 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.23.0@f1fe6ff483bf325c803df9f510d09a03fd796f88"> <files psalm-version="4.24.0@06dd975cb55d36af80f242561738f16c5f58264f">
<file src="../phpseclib/Common/Functions/Strings.php"> <file src="../phpseclib/Common/Functions/Strings.php">
<MissingParamType occurrences="1"> <MissingParamType occurrences="1">
<code>$var</code> <code>$var</code>
@ -2048,7 +2048,7 @@
<MixedArrayOffset occurrences="1"> <MixedArrayOffset occurrences="1">
<code>[static::OID_NAME =&gt; static::OID_VALUE]</code> <code>[static::OID_NAME =&gt; static::OID_VALUE]</code>
</MixedArrayOffset> </MixedArrayOffset>
<MixedAssignment occurrences="15"> <MixedAssignment occurrences="16">
<code>$algorithm</code> <code>$algorithm</code>
<code>$encryptionAlgorithm</code> <code>$encryptionAlgorithm</code>
<code>$encryptionScheme</code> <code>$encryptionScheme</code>
@ -2057,6 +2057,7 @@
<code>$key</code> <code>$key</code>
<code>$key</code> <code>$key</code>
<code>$key['privateKeyAlgorithm']['parameters']</code> <code>$key['privateKeyAlgorithm']['parameters']</code>
<code>$key['publicKeyAlgorithm']['parameters']</code>
<code>$meta['meta']['algorithm']</code> <code>$meta['meta']['algorithm']</code>
<code>$meta['meta']['cipher']</code> <code>$meta['meta']['cipher']</code>
<code>$meta['meta']['keyDerivationFunc']</code> <code>$meta['meta']['keyDerivationFunc']</code>
@ -7808,7 +7809,7 @@
<code>$t</code> <code>$t</code>
</MixedOperand> </MixedOperand>
<MoreSpecificReturnType occurrences="1"> <MoreSpecificReturnType occurrences="1">
<code>RSA</code> <code>PrivateKey</code>
</MoreSpecificReturnType> </MoreSpecificReturnType>
<PossiblyFalseArgument occurrences="4"> <PossiblyFalseArgument occurrences="4">
<code>$primes[$i]</code> <code>$primes[$i]</code>
@ -9965,10 +9966,14 @@
<code>$this-&gt;x</code> <code>$this-&gt;x</code>
<code>$this-&gt;x + 1</code> <code>$this-&gt;x + 1</code>
</PossiblyInvalidArgument> </PossiblyInvalidArgument>
<PossiblyInvalidPropertyAssignmentValue occurrences="5"> <PossiblyInvalidPropertyAssignmentValue occurrences="9">
<code>$match[2] - 1</code> <code>$match[2] - 1</code>
<code>$this-&gt;x</code> <code>$this-&gt;x</code>
<code>$this-&gt;x</code> <code>$this-&gt;x</code>
<code>$this-&gt;x</code>
<code>$this-&gt;x</code>
<code>$this-&gt;x</code>
<code>$this-&gt;x</code>
<code>$this-&gt;x += $match[1]</code> <code>$this-&gt;x += $match[1]</code>
<code>$this-&gt;x -= $match[1]</code> <code>$this-&gt;x -= $match[1]</code>
</PossiblyInvalidPropertyAssignmentValue> </PossiblyInvalidPropertyAssignmentValue>
@ -9987,7 +9992,7 @@
<PossiblyUnusedReturnValue occurrences="1"> <PossiblyUnusedReturnValue occurrences="1">
<code>\phpseclib3\File\ANSI</code> <code>\phpseclib3\File\ANSI</code>
</PossiblyUnusedReturnValue> </PossiblyUnusedReturnValue>
<PropertyNotSetInConstructor occurrences="13"> <PropertyNotSetInConstructor occurrences="14">
<code>$ansi</code> <code>$ansi</code>
<code>$attr_row</code> <code>$attr_row</code>
<code>$attrs</code> <code>$attrs</code>
@ -9996,6 +10001,7 @@
<code>$max_history</code> <code>$max_history</code>
<code>$max_x</code> <code>$max_x</code>
<code>$max_y</code> <code>$max_y</code>
<code>$old_x</code>
<code>$old_y</code> <code>$old_y</code>
<code>$screen</code> <code>$screen</code>
<code>$tokenization</code> <code>$tokenization</code>
@ -10009,6 +10015,9 @@
<code>$this-&gt;screen</code> <code>$this-&gt;screen</code>
<code>$this-&gt;screen</code> <code>$this-&gt;screen</code>
</PropertyTypeCoercion> </PropertyTypeCoercion>
<UnusedProperty occurrences="1">
<code>$old_x</code>
</UnusedProperty>
</file> </file>
<file src="../phpseclib/File/ASN1.php"> <file src="../phpseclib/File/ASN1.php">
<DocblockTypeContradiction occurrences="4"> <DocblockTypeContradiction occurrences="4">
@ -14441,7 +14450,7 @@
<code>readlink</code> <code>readlink</code>
<code>realpath</code> <code>realpath</code>
</MissingReturnType> </MissingReturnType>
<MixedArgument occurrences="75"> <MixedArgument occurrences="72">
<code>$a['filename']</code> <code>$a['filename']</code>
<code>$attr['mode']</code> <code>$attr['mode']</code>
<code>$b['filename']</code> <code>$b['filename']</code>
@ -14475,7 +14484,6 @@
<code>$fp</code> <code>$fp</code>
<code>$fp</code> <code>$fp</code>
<code>$length</code> <code>$length</code>
<code>$length + $res_offset</code>
<code>$link</code> <code>$link</code>
<code>$link</code> <code>$link</code>
<code>$link</code> <code>$link</code>
@ -14492,8 +14500,6 @@
<code>$remote_file</code> <code>$remote_file</code>
<code>$remote_file</code> <code>$remote_file</code>
<code>$stat['atime']</code> <code>$stat['atime']</code>
<code>$stat['atime']</code>
<code>$stat['mtime']</code>
<code>$stat['mtime']</code> <code>$stat['mtime']</code>
<code>$status</code> <code>$status</code>
<code>$status</code> <code>$status</code>
@ -14539,7 +14545,7 @@
<code>$this-&gt;requestBuffer[$packet_id]</code> <code>$this-&gt;requestBuffer[$packet_id]</code>
<code>$this-&gt;requestBuffer[$request_id]</code> <code>$this-&gt;requestBuffer[$request_id]</code>
</MixedArrayOffset> </MixedArrayOffset>
<MixedAssignment occurrences="68"> <MixedAssignment occurrences="64">
<code>$a[$sort]</code> <code>$a[$sort]</code>
<code>$attr</code> <code>$attr</code>
<code>$attr</code> <code>$attr</code>
@ -14576,7 +14582,6 @@
<code>$props</code> <code>$props</code>
<code>$remote_file</code> <code>$remote_file</code>
<code>$remote_file</code> <code>$remote_file</code>
<code>$res_offset</code>
<code>$response</code> <code>$response</code>
<code>$response</code> <code>$response</code>
<code>$response</code> <code>$response</code>
@ -14588,9 +14593,6 @@
<code>$result</code> <code>$result</code>
<code>$result</code> <code>$result</code>
<code>$size</code> <code>$size</code>
<code>$size</code>
<code>$size</code>
<code>$size</code>
<code>$subtemp</code> <code>$subtemp</code>
<code>$temp</code> <code>$temp</code>
<code>$temp</code> <code>$temp</code>
@ -14619,7 +14621,7 @@
<code>string</code> <code>string</code>
<code>string|bool</code> <code>string|bool</code>
</MixedInferredReturnType> </MixedInferredReturnType>
<MixedOperand occurrences="31"> <MixedOperand occurrences="28">
<code>$a[$sort]</code> <code>$a[$sort]</code>
<code>$a[$sort]</code> <code>$a[$sort]</code>
<code>$attr</code> <code>$attr</code>
@ -14636,11 +14638,8 @@
<code>$key</code> <code>$key</code>
<code>$length</code> <code>$length</code>
<code>$offset</code> <code>$offset</code>
<code>$res_offset</code>
<code>$shortname</code> <code>$shortname</code>
<code>$shortname</code> <code>$shortname</code>
<code>$size</code>
<code>$size</code>
<code>$start</code> <code>$start</code>
<code>$subtemp</code> <code>$subtemp</code>
<code>$temp</code> <code>$temp</code>
@ -14737,7 +14736,7 @@
<code>$this-&gt;channel_status[self::CHANNEL]</code> <code>$this-&gt;channel_status[self::CHANNEL]</code>
<code>$this-&gt;server_channels[self::CHANNEL]</code> <code>$this-&gt;server_channels[self::CHANNEL]</code>
</PossiblyUndefinedIntArrayOffset> </PossiblyUndefinedIntArrayOffset>
<PossiblyUndefinedStringArrayOffset occurrences="20"> <PossiblyUndefinedStringArrayOffset occurrences="14">
<code>$a['filename']</code> <code>$a['filename']</code>
<code>$a['filename']</code> <code>$a['filename']</code>
<code>$a['filename']</code> <code>$a['filename']</code>
@ -14749,13 +14748,7 @@
<code>$b['filename']</code> <code>$b['filename']</code>
<code>$b['filename']</code> <code>$b['filename']</code>
<code>$stat['atime']</code> <code>$stat['atime']</code>
<code>$stat['atime']</code>
<code>$stat['atime']</code>
<code>$stat['mtime']</code> <code>$stat['mtime']</code>
<code>$stat['mtime']</code>
<code>$stat['mtime']</code>
<code>$stat['size']</code>
<code>$stat['size']</code>
<code>$stat['type']</code> <code>$stat['type']</code>
<code>$this-&gt;stat($remote_file)['size']</code> <code>$this-&gt;stat($remote_file)['size']</code>
</PossiblyUndefinedStringArrayOffset> </PossiblyUndefinedStringArrayOffset>
@ -17114,8 +17107,7 @@
<MissingParamType occurrences="1"> <MissingParamType occurrences="1">
<code>$args</code> <code>$args</code>
</MissingParamType> </MissingParamType>
<MixedArgument occurrences="4"> <MixedArgument occurrences="3">
<code>$key</code>
<code>$r['primes']</code> <code>$r['primes']</code>
<code>$r['primes']</code> <code>$r['primes']</code>
<code>$rsa-&gt;getPublicKey()-&gt;toString('PKCS1')</code> <code>$rsa-&gt;getPublicKey()-&gt;toString('PKCS1')</code>
@ -17124,21 +17116,19 @@
<code>$privatekey</code> <code>$privatekey</code>
<code>$publickey</code> <code>$publickey</code>
</MixedArrayAccess> </MixedArrayAccess>
<MixedAssignment occurrences="7"> <MixedAssignment occurrences="6">
<code>$actual</code> <code>$actual</code>
<code>$ciphertext</code> <code>$ciphertext</code>
<code>$key</code>
<code>$plaintext</code> <code>$plaintext</code>
<code>$prime</code> <code>$prime</code>
<code>$signature</code> <code>$signature</code>
<code>[$publickey, $privatekey]</code> <code>[$publickey, $privatekey]</code>
</MixedAssignment> </MixedAssignment>
<MixedMethodCall occurrences="5"> <MixedMethodCall occurrences="4">
<code>decrypt</code> <code>decrypt</code>
<code>encrypt</code> <code>encrypt</code>
<code>getLength</code> <code>getLength</code>
<code>toString</code> <code>toString</code>
<code>toString</code>
</MixedMethodCall> </MixedMethodCall>
<PossiblyUndefinedStringArrayOffset occurrences="3"> <PossiblyUndefinedStringArrayOffset occurrences="3">
<code>$r['primes']</code> <code>$r['primes']</code>
@ -17149,13 +17139,10 @@
<code>CreateKeyTest</code> <code>CreateKeyTest</code>
<code>CreateKeyTest</code> <code>CreateKeyTest</code>
</PropertyNotSetInConstructor> </PropertyNotSetInConstructor>
<UndefinedMethod occurrences="6"> <UndefinedMethod occurrences="3">
<code>getPublicKey</code>
<code>getPublicKey</code>
<code>getPublicKey</code> <code>getPublicKey</code>
<code>sign</code> <code>sign</code>
<code>verify</code> <code>verify</code>
<code>withPassword</code>
</UndefinedMethod> </UndefinedMethod>
<UnusedClass occurrences="1"> <UnusedClass occurrences="1">
<code>CreateKeyTest</code> <code>CreateKeyTest</code>
@ -17609,11 +17596,10 @@
<code>'phpseclib3\Math\BigInteger'</code> <code>'phpseclib3\Math\BigInteger'</code>
</ArgumentTypeCoercion> </ArgumentTypeCoercion>
<InvalidArgument occurrences="1"> <InvalidArgument occurrences="1">
<code>$privateKey</code>
</InvalidArgument>
<MixedArgument occurrences="4">
<code>$authority-&gt;sign($issuer, $subject)</code>
<code>$publicKey</code> <code>$publicKey</code>
</InvalidArgument>
<MixedArgument occurrences="3">
<code>$authority-&gt;sign($issuer, $subject)</code>
<code>$result</code> <code>$result</code>
<code>$subjectKey</code> <code>$subjectKey</code>
</MixedArgument> </MixedArgument>
@ -17628,11 +17614,10 @@
<code>$extension['extnValue']</code> <code>$extension['extnValue']</code>
<code>$loader-&gt;loadX509($cert)['tbsCertificate']</code> <code>$loader-&gt;loadX509($cert)['tbsCertificate']</code>
</MixedArrayAccess> </MixedArrayAccess>
<MixedAssignment occurrences="6"> <MixedAssignment occurrences="5">
<code>$customExtensionDecodedData</code> <code>$customExtensionDecodedData</code>
<code>$decodedData</code> <code>$decodedData</code>
<code>$extension</code> <code>$extension</code>
<code>$publicKey</code>
<code>$result</code> <code>$result</code>
<code>$subjectKey</code> <code>$subjectKey</code>
</MixedAssignment> </MixedAssignment>
@ -17651,9 +17636,6 @@
<code>X509ExtensionTest</code> <code>X509ExtensionTest</code>
<code>X509ExtensionTest</code> <code>X509ExtensionTest</code>
</PropertyNotSetInConstructor> </PropertyNotSetInConstructor>
<UndefinedMethod occurrences="1">
<code>getPublicKey</code>
</UndefinedMethod>
<UnusedClass occurrences="1"> <UnusedClass occurrences="1">
<code>X509ExtensionTest</code> <code>X509ExtensionTest</code>
</UnusedClass> </UnusedClass>

View File

@ -76,6 +76,13 @@ class ANSI
*/ */
private $y; private $y;
/**
* Old Column
*
* @var int
*/
private $old_x;
/** /**
* Old Row * Old Row
* *
@ -214,6 +221,7 @@ class ANSI
// http://ascii-table.com/ansi-escape-sequences-vt-100.php // http://ascii-table.com/ansi-escape-sequences-vt-100.php
switch ($this->ansi) { switch ($this->ansi) {
case "\x1B[H": // Move cursor to upper left corner case "\x1B[H": // Move cursor to upper left corner
$this->old_x = $this->x;
$this->old_y = $this->y; $this->old_y = $this->y;
$this->x = $this->y = 0; $this->x = $this->y = 0;
break; break;
@ -253,14 +261,17 @@ class ANSI
$this->y += (int) $match[1]; $this->y += (int) $match[1];
break; break;
case preg_match('#\x1B\[(\d+);(\d+)H#', $this->ansi, $match): // Move cursor to screen location v,h 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->old_y = $this->y;
$this->x = $match[2] - 1; $this->x = $match[2] - 1;
$this->y = (int) $match[1] - 1; $this->y = (int) $match[1] - 1;
break; break;
case preg_match('#\x1B\[(\d+)C#', $this->ansi, $match): // Move cursor right n lines case preg_match('#\x1B\[(\d+)C#', $this->ansi, $match): // Move cursor right n lines
$this->old_x = $this->x;
$this->x += $match[1]; $this->x += $match[1];
break; break;
case preg_match('#\x1B\[(\d+)D#', $this->ansi, $match): // Move cursor left n lines case preg_match('#\x1B\[(\d+)D#', $this->ansi, $match): // Move cursor left n lines
$this->old_x = $this->x;
$this->x -= $match[1]; $this->x -= $match[1];
if ($this->x < 0) { if ($this->x < 0) {
$this->x = 0; $this->x = 0;