diff options
author | Andreas Gohr <andi@splitbrain.org> | 2024-03-05 15:08:02 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2024-03-05 15:08:02 +0100 |
commit | c13ef3ba1de57be630245f8ce5de354bdf7dc966 (patch) | |
tree | acd5c99067021eac360ca4b54499f2c1ecfdc5bf /vendor | |
parent | ff6a7a9d5faee648df31090bfa612e064ab19bfd (diff) | |
download | dokuwiki-c13ef3ba1de57be630245f8ce5de354bdf7dc966.tar.gz dokuwiki-c13ef3ba1de57be630245f8ce5de354bdf7dc966.zip |
composer updates
Diffstat (limited to 'vendor')
19 files changed, 243 insertions, 71 deletions
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 2c7e80332..fc724d26e 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -19,6 +19,7 @@ return array( 'HTMLCreator' => $vendorDir . '/openpsa/universalfeedcreator/lib/Creator/HTMLCreator.php', 'HtmlDescribable' => $vendorDir . '/openpsa/universalfeedcreator/lib/Element/HtmlDescribable.php', 'JSCreator' => $vendorDir . '/openpsa/universalfeedcreator/lib/Creator/JSCreator.php', + 'JSONCreator' => $vendorDir . '/openpsa/universalfeedcreator/lib/Creator/JSONCreator.php', 'KMLCreator' => $vendorDir . '/openpsa/universalfeedcreator/lib/Creator/KMLCreator.php', 'MBOXCreator' => $vendorDir . '/openpsa/universalfeedcreator/lib/Creator/MBOXCreator.php', 'OPMLCreator' => $vendorDir . '/openpsa/universalfeedcreator/lib/Creator/OPMLCreator.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index ea7a7c731..7d2048fe0 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -131,6 +131,7 @@ class ComposerStaticInita19a915ee98347a0c787119619d2ff9b 'HTMLCreator' => __DIR__ . '/..' . '/openpsa/universalfeedcreator/lib/Creator/HTMLCreator.php', 'HtmlDescribable' => __DIR__ . '/..' . '/openpsa/universalfeedcreator/lib/Element/HtmlDescribable.php', 'JSCreator' => __DIR__ . '/..' . '/openpsa/universalfeedcreator/lib/Creator/JSCreator.php', + 'JSONCreator' => __DIR__ . '/..' . '/openpsa/universalfeedcreator/lib/Creator/JSONCreator.php', 'KMLCreator' => __DIR__ . '/..' . '/openpsa/universalfeedcreator/lib/Creator/KMLCreator.php', 'MBOXCreator' => __DIR__ . '/..' . '/openpsa/universalfeedcreator/lib/Creator/MBOXCreator.php', 'OPMLCreator' => __DIR__ . '/..' . '/openpsa/universalfeedcreator/lib/Creator/OPMLCreator.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index ef5ea9170..6c40d07ca 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -151,17 +151,17 @@ }, { "name": "openpsa/universalfeedcreator", - "version": "v1.8.6", - "version_normalized": "1.8.6.0", + "version": "v1.9.0", + "version_normalized": "1.9.0.0", "source": { "type": "git", "url": "https://github.com/flack/UniversalFeedCreator.git", - "reference": "3abf36ef9d3a3b31a3c330caea7d5176f0396301" + "reference": "c55f908e867aa6dade0905b8aefb94fd9d8c1f9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/flack/UniversalFeedCreator/zipball/3abf36ef9d3a3b31a3c330caea7d5176f0396301", - "reference": "3abf36ef9d3a3b31a3c330caea7d5176f0396301", + "url": "https://api.github.com/repos/flack/UniversalFeedCreator/zipball/c55f908e867aa6dade0905b8aefb94fd9d8c1f9e", + "reference": "c55f908e867aa6dade0905b8aefb94fd9d8c1f9e", "shasum": "" }, "require": { @@ -170,7 +170,7 @@ "require-dev": { "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.32 || ^9.5.10" }, - "time": "2024-01-23T15:59:31+00:00", + "time": "2024-02-22T11:08:24+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -203,7 +203,7 @@ ], "support": { "issues": "https://github.com/flack/UniversalFeedCreator/issues", - "source": "https://github.com/flack/UniversalFeedCreator/tree/v1.8.6" + "source": "https://github.com/flack/UniversalFeedCreator/tree/v1.9.0" }, "install-path": "../openpsa/universalfeedcreator" }, @@ -332,17 +332,17 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.35", - "version_normalized": "3.0.35.0", + "version": "3.0.37", + "version_normalized": "3.0.37.0", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "4b1827beabce71953ca479485c0ae9c51287f2fe" + "reference": "cfa2013d0f68c062055180dd4328cc8b9d1f30b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/4b1827beabce71953ca479485c0ae9c51287f2fe", - "reference": "4b1827beabce71953ca479485c0ae9c51287f2fe", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/cfa2013d0f68c062055180dd4328cc8b9d1f30b8", + "reference": "cfa2013d0f68c062055180dd4328cc8b9d1f30b8", "shasum": "" }, "require": { @@ -360,7 +360,7 @@ "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." }, - "time": "2023-12-29T01:59:53+00:00", + "time": "2024-03-03T02:14:58+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -425,7 +425,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.35" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.37" }, "funding": [ { @@ -524,17 +524,17 @@ }, { "name": "splitbrain/lesserphp", - "version": "v0.10.0", - "version_normalized": "0.10.0.0", + "version": "v0.10.1", + "version_normalized": "0.10.1.0", "source": { "type": "git", "url": "https://github.com/splitbrain/lesserphp.git", - "reference": "2e5d20c4ce9186a34554a137a4a1784fc5c29505" + "reference": "64e2ab63ddd399d9ef071e9a6bd778c6ddcc8db0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/splitbrain/lesserphp/zipball/2e5d20c4ce9186a34554a137a4a1784fc5c29505", - "reference": "2e5d20c4ce9186a34554a137a4a1784fc5c29505", + "url": "https://api.github.com/repos/splitbrain/lesserphp/zipball/64e2ab63ddd399d9ef071e9a6bd778c6ddcc8db0", + "reference": "64e2ab63ddd399d9ef071e9a6bd778c6ddcc8db0", "shasum": "" }, "require": { @@ -548,7 +548,7 @@ "suggest": { "ext-fileinfo": "For mime type guessing of embedded files" }, - "time": "2024-02-02T11:47:26+00:00", + "time": "2024-02-02T18:31:26+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -582,7 +582,7 @@ "description": "lesserphp is a compiler for LESS written in PHP based on leafo's lessphp.", "support": { "issues": "https://github.com/splitbrain/lesserphp/issues", - "source": "https://github.com/splitbrain/lesserphp/tree/v0.10.0" + "source": "https://github.com/splitbrain/lesserphp/tree/v0.10.1" }, "install-path": "../splitbrain/lesserphp" }, @@ -762,17 +762,17 @@ }, { "name": "splitbrain/slika", - "version": "1.0.6", - "version_normalized": "1.0.6.0", + "version": "1.0.7", + "version_normalized": "1.0.7.0", "source": { "type": "git", "url": "https://github.com/splitbrain/slika.git", - "reference": "274511fc654fa29cb7cfc039bed97a5ea786f1a0" + "reference": "93cd2034628136b4fa322f7f1ac3d57293a6c08d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/splitbrain/slika/zipball/274511fc654fa29cb7cfc039bed97a5ea786f1a0", - "reference": "274511fc654fa29cb7cfc039bed97a5ea786f1a0", + "url": "https://api.github.com/repos/splitbrain/slika/zipball/93cd2034628136b4fa322f7f1ac3d57293a6c08d", + "reference": "93cd2034628136b4fa322f7f1ac3d57293a6c08d", "shasum": "" }, "require": { @@ -784,7 +784,7 @@ "suggest": { "ext-gd": "PHP's builtin image manipulation library. Alternatively use an installation of ImageMagick" }, - "time": "2023-10-26T10:06:48+00:00", + "time": "2024-01-28T09:41:46+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -806,7 +806,7 @@ "description": "Simple image resizing", "support": { "issues": "https://github.com/splitbrain/slika/issues", - "source": "https://github.com/splitbrain/slika/tree/1.0.6" + "source": "https://github.com/splitbrain/slika/tree/1.0.7" }, "install-path": "../splitbrain/slika" } diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 0766ed655..4001ee9a0 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'dokuwiki/dokuwiki', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '87f6c7185502767dd23d1039195eed23f0048dd1', + 'reference' => 'ff6a7a9d5faee648df31090bfa612e064ab19bfd', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -22,7 +22,7 @@ 'dokuwiki/dokuwiki' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '87f6c7185502767dd23d1039195eed23f0048dd1', + 'reference' => 'ff6a7a9d5faee648df31090bfa612e064ab19bfd', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -50,9 +50,9 @@ 'dev_requirement' => false, ), 'openpsa/universalfeedcreator' => array( - 'pretty_version' => 'v1.8.6', - 'version' => '1.8.6.0', - 'reference' => '3abf36ef9d3a3b31a3c330caea7d5176f0396301', + 'pretty_version' => 'v1.9.0', + 'version' => '1.9.0.0', + 'reference' => 'c55f908e867aa6dade0905b8aefb94fd9d8c1f9e', 'type' => 'library', 'install_path' => __DIR__ . '/../openpsa/universalfeedcreator', 'aliases' => array(), @@ -77,9 +77,9 @@ 'dev_requirement' => false, ), 'phpseclib/phpseclib' => array( - 'pretty_version' => '3.0.35', - 'version' => '3.0.35.0', - 'reference' => '4b1827beabce71953ca479485c0ae9c51287f2fe', + 'pretty_version' => '3.0.37', + 'version' => '3.0.37.0', + 'reference' => 'cfa2013d0f68c062055180dd4328cc8b9d1f30b8', 'type' => 'library', 'install_path' => __DIR__ . '/../phpseclib/phpseclib', 'aliases' => array(), @@ -95,9 +95,9 @@ 'dev_requirement' => false, ), 'splitbrain/lesserphp' => array( - 'pretty_version' => 'v0.10.0', - 'version' => '0.10.0.0', - 'reference' => '2e5d20c4ce9186a34554a137a4a1784fc5c29505', + 'pretty_version' => 'v0.10.1', + 'version' => '0.10.1.0', + 'reference' => '64e2ab63ddd399d9ef071e9a6bd778c6ddcc8db0', 'type' => 'library', 'install_path' => __DIR__ . '/../splitbrain/lesserphp', 'aliases' => array(), @@ -131,9 +131,9 @@ 'dev_requirement' => false, ), 'splitbrain/slika' => array( - 'pretty_version' => '1.0.6', - 'version' => '1.0.6.0', - 'reference' => '274511fc654fa29cb7cfc039bed97a5ea786f1a0', + 'pretty_version' => '1.0.7', + 'version' => '1.0.7.0', + 'reference' => '93cd2034628136b4fa322f7f1ac3d57293a6c08d', 'type' => 'library', 'install_path' => __DIR__ . '/../splitbrain/slika', 'aliases' => array(), diff --git a/vendor/openpsa/universalfeedcreator/lib/Creator/JSONCreator.php b/vendor/openpsa/universalfeedcreator/lib/Creator/JSONCreator.php new file mode 100644 index 000000000..161d3b4ee --- /dev/null +++ b/vendor/openpsa/universalfeedcreator/lib/Creator/JSONCreator.php @@ -0,0 +1,66 @@ +<?php + +/** + * JSONCreator is a FeedCreator that implements the JSON Feed specification, + * as in https://jsonfeed.org/version/1.1 + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +class JSONCreator extends FeedCreator +{ + /** @inheritdoc */ + public function createFeed() + { + $data = array(); + + $data['version'] = 'https://jsonfeed.org/version/1.1'; + $data['title'] = (string)$this->title; + $data['home_page_url'] = (string)$this->link; + $data['feed_url'] = (string)$this->syndicationURL; + $data['description'] = (string)$this->description; + $data['user_comment'] = 'Created by ' . FEEDCREATOR_VERSION; + if ($this->image != null) { + $data['icon'] = $this->image->url; + } + if ($this->language != '') { + $data['language'] = $this->language; + } + + $data['items'] = array(); + foreach ($this->items as $item) { + $entry = array(); + $entry['id'] = $item->guid ? (string)$item->guid : (string)$item->link; + $entry['url'] = (string)$item->link; + if ($item->source) { + $entry['external_url'] = (string)$item->source; + } + $entry['title'] = strip_tags((string)$item->title); + $entry['content_text'] = strip_tags((string)$item->description); + $entry['content_html'] = (string)$item->description; + $entry['date_published'] = (new FeedDate($item->date))->iso8601(); + if ($item->author) { + // We only support one author, JSONFeed 1.1 accepts multiple + $entry['authors'] = array(array('name' => (string)$item->author)); + // 1.0 only supported one, for compatibility we set it as well + $entry['author'] = array('name' => (string)$item->author); + } + if ($item->category) { + $entry['tags'] = (array)$item->category; + } + if ($item->enclosure) { + // We only support one enclosure, JSONFeed 1.1 accepts multiple + $entry['attachments'] = array( + array( + 'url' => $item->enclosure['url'], + 'mime_type' => $item->enclosure['type'], + 'size_in_bytes' => $item->enclosure['length'] + ) + ); + } + + $data['items'][] = $entry; + } + + return json_encode($data); + } +} diff --git a/vendor/openpsa/universalfeedcreator/lib/UniversalFeedCreator.php b/vendor/openpsa/universalfeedcreator/lib/UniversalFeedCreator.php index 297d38229..53a8885f2 100644 --- a/vendor/openpsa/universalfeedcreator/lib/UniversalFeedCreator.php +++ b/vendor/openpsa/universalfeedcreator/lib/UniversalFeedCreator.php @@ -88,6 +88,10 @@ class UniversalFeedCreator extends FeedCreator $this->_feed = new JSCreator(); break; + case "JSON": + $this->_feed = new JSONCreator(); + break; + default: $this->_feed = new RSSCreator091(); break; diff --git a/vendor/phpseclib/phpseclib/BACKERS.md b/vendor/phpseclib/phpseclib/BACKERS.md index 4ee6a4f9b..efca482ad 100644 --- a/vendor/phpseclib/phpseclib/BACKERS.md +++ b/vendor/phpseclib/phpseclib/BACKERS.md @@ -13,4 +13,5 @@ phpseclib ongoing development is made possible by [Tidelift](https://tidelift.co - [Rachel Fish](https://github.com/itsrachelfish) - Tharyrok - [cjhaas](https://github.com/cjhaas) -- [istiak-tridip](https://github.com/istiak-tridip)
\ No newline at end of file +- [istiak-tridip](https://github.com/istiak-tridip) +- [Anna Filina](https://github.com/afilina)
\ No newline at end of file diff --git a/vendor/phpseclib/phpseclib/README.md b/vendor/phpseclib/phpseclib/README.md index 98e57968a..37cbcb9d5 100644 --- a/vendor/phpseclib/phpseclib/README.md +++ b/vendor/phpseclib/phpseclib/README.md @@ -51,7 +51,7 @@ SSH-2, SFTP, X.509, an arbitrary-precision integer arithmetic library, Ed25519 / * PHP4 compatible * Composer compatible (PSR-0 autoloading) * Install using Composer: `composer require phpseclib/phpseclib:~1.0` -* [Download 1.0.22 as ZIP](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.22.zip/download) +* [Download 1.0.23 as ZIP](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.23.zip/download) ## Security contact information diff --git a/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/PrivateKey.php b/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/PrivateKey.php index 462ea1a33..598869614 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/PrivateKey.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/PrivateKey.php @@ -150,7 +150,7 @@ final class PrivateKey extends EC implements Common\PrivateKey // we use specified curves to avoid issues with OpenSSL possibly not supporting a given named curve; // doing this may mean some curve-specific optimizations can't be used but idk if OpenSSL even // has curve-specific optimizations - $result = openssl_sign($message, $signature, $this->toString('PKCS8', ['namedCurve' => false]), $this->hash->getHash()); + $result = openssl_sign($message, $signature, $this->withPassword()->toString('PKCS8', ['namedCurve' => false]), $this->hash->getHash()); if ($result) { if ($shortFormat == 'ASN1') { diff --git a/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php b/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php index 3096ff1a1..c4b06a560 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php +++ b/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php @@ -1148,6 +1148,11 @@ abstract class ASN1 $oid = []; $pos = 0; $len = strlen($content); + // see https://github.com/openjdk/jdk/blob/2deb318c9f047ec5a4b160d66a4b52f93688ec42/src/java.base/share/classes/sun/security/util/ObjectIdentifier.java#L55 + if ($len > 4096) { + //throw new \RuntimeException("Object identifier size is limited to 4096 bytes ($len bytes present)"); + return false; + } if (ord($content[$len - 1]) & 0x80) { return false; diff --git a/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/Engine.php b/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/Engine.php index abdf3b475..474abe105 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/Engine.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/Engine.php @@ -619,7 +619,7 @@ abstract class Engine implements \JsonSerializable */ public function getLengthInBytes() { - return strlen($this->toBytes()); + return (int) ceil($this->getLength() / 8); } /** @@ -786,6 +786,11 @@ abstract class Engine implements \JsonSerializable $min = $temp; } + $length = $max->getLength(); + if ($length > 8196) { + throw new \RuntimeException("Generation of random prime numbers larger than 8196 has been disabled ($length)"); + } + $x = static::randomRange($min, $max); return static::randomRangePrimeInner($x, $min, $max); @@ -990,6 +995,15 @@ abstract class Engine implements \JsonSerializable */ public function isPrime($t = false) { + // OpenSSL limits RSA keys to 16384 bits. The length of an RSA key is equal to the length of the modulo, which is + // produced by multiplying the primes p and q by one another. The largest number two 8196 bit primes can produce is + // a 16384 bit number so, basically, 8196 bit primes are the largest OpenSSL will generate and if that's the largest + // that it'll generate it also stands to reason that that's the largest you'll be able to test primality on + $length = $this->getLength(); + if ($length > 8196) { + throw new \RuntimeException("Primality testing is not supported for numbers larger than 8196 bits ($length)"); + } + if (!$t) { $t = $this->setupIsPrime(); } diff --git a/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP.php b/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP.php index 7e85783ef..2d8959522 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP.php @@ -1341,4 +1341,17 @@ abstract class PHP extends Engine } return false; } + + /** + * Return the size of a BigInteger in bits + * + * @return int + */ + public function getLength() + { + $max = count($this->value) - 1; + return $max != -1 ? + $max * static::BASE + intval(ceil(log($this->value[$max] + 1, 2))) : + 0; + } } diff --git a/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php b/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php index 45f748dfc..144ef7950 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php @@ -547,7 +547,7 @@ class SFTP extends SSH2 */ private function partial_init_sftp_connection() { - $response = $this->openChannel(self::CHANNEL, true); + $response = $this->open_channel(self::CHANNEL, true); if ($response === true && $this->isTimeout()) { return false; } @@ -2129,8 +2129,8 @@ class SFTP extends SSH2 $offset = $start; } elseif ($mode & (self::RESUME | self::RESUME_START)) { // if NET_SFTP_OPEN_APPEND worked as it should _size() wouldn't need to be called - $size = $this->stat($remote_file)['size']; - $offset = $size !== false ? $size : 0; + $stat = $this->stat($remote_file); + $offset = $stat !== false && $stat['size'] ? $stat['size'] : 0; } else { $offset = 0; if ($this->version >= 5) { @@ -3446,7 +3446,7 @@ class SFTP extends SSH2 } /** - * Returns all errors + * Returns all errors on the SFTP layer * * @return array */ @@ -3456,7 +3456,7 @@ class SFTP extends SSH2 } /** - * Returns the last error + * Returns the last error on the SFTP layer * * @return string */ diff --git a/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php b/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php index ac70af9ca..eee2e108d 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php @@ -1116,6 +1116,8 @@ class SSH2 * Default Constructor. * * $host can either be a string, representing the host, or a stream resource. + * If $host is a stream resource then $port doesn't do anything, altho $timeout + * still will be used * * @param mixed $host * @param int $port @@ -1214,6 +1216,8 @@ class SSH2 ? \WeakReference::create($this) : $this; + $this->timeout = $timeout; + if (is_resource($host)) { $this->fsock = $host; return; @@ -1222,7 +1226,6 @@ class SSH2 if (Strings::is_stringable($host)) { $this->host = $host; $this->port = $port; - $this->timeout = $timeout; } } @@ -2837,7 +2840,7 @@ class SSH2 // throw new \RuntimeException('If you want to run multiple exec()\'s you will need to disable (and re-enable if appropriate) a PTY for each one.'); //} - $this->openChannel(self::CHANNEL_EXEC); + $this->open_channel(self::CHANNEL_EXEC); if ($this->request_pty === true) { $terminal_modes = pack('C', NET_SSH2_TTY_OP_END); @@ -2934,7 +2937,7 @@ class SSH2 * @param bool $skip_extended * @return bool */ - protected function openChannel($channel, $skip_extended = false) + protected function open_channel($channel, $skip_extended = false) { if (isset($this->channel_status[$channel]) && $this->channel_status[$channel] != NET_SSH2_MSG_CHANNEL_CLOSE) { throw new \RuntimeException('Please close the channel (' . $channel . ') before trying to open it again'); @@ -2991,7 +2994,7 @@ class SSH2 throw new InsufficientSetupException('Operation disallowed prior to login()'); } - $this->openChannel(self::CHANNEL_SHELL); + $this->open_channel(self::CHANNEL_SHELL); $terminal_modes = pack('C', NET_SSH2_TTY_OP_END); $packet = Strings::packSSH2( @@ -3239,7 +3242,7 @@ class SSH2 */ public function startSubsystem($subsystem) { - $this->openChannel(self::CHANNEL_SUBSYSTEM); + $this->open_channel(self::CHANNEL_SUBSYSTEM); $packet = Strings::packSSH2( 'CNsCs', @@ -3341,11 +3344,38 @@ class SSH2 /** * Is the connection still active? * + * $level has 3x possible values: + * 0 (default): phpseclib takes a passive approach to see if the connection is still active by calling feof() + * on the socket + * 1: phpseclib takes an active approach to see if the connection is still active by sending an SSH_MSG_IGNORE + * packet that doesn't require a response + * 2: phpseclib takes an active approach to see if the connection is still active by sending an SSH_MSG_CHANNEL_OPEN + * packet and imediately trying to close that channel. some routers, in particular, however, will only let you + * open one channel, so this approach could yield false positives + * + * @param int $level * @return bool */ - public function isConnected() + public function isConnected($level = 0) { - return ($this->bitmap & self::MASK_CONNECTED) && is_resource($this->fsock) && !feof($this->fsock); + if (!is_int($level) || $level < 0 || $level > 2) { + throw new \InvalidArgumentException('$level must be 0, 1 or 2'); + } + + if ($level == 0) { + return ($this->bitmap & self::MASK_CONNECTED) && is_resource($this->fsock) && !feof($this->fsock); + } + try { + if ($level == 1) { + $this->send_binary_packet(pack('CN', NET_SSH2_MSG_IGNORE, 0)); + } else { + $this->open_channel(self::CHANNEL_KEEP_ALIVE); + $this->close_channel(self::CHANNEL_KEEP_ALIVE); + } + return true; + } catch (\Exception $e) { + return false; + } } /** @@ -3418,7 +3448,7 @@ class SSH2 } try { - $this->openChannel(self::CHANNEL_KEEP_ALIVE); + $this->open_channel(self::CHANNEL_KEEP_ALIVE); } catch (\RuntimeException $e) { return $this->reconnect(); } @@ -3531,6 +3561,11 @@ class SSH2 } $start = microtime(true); + if ($this->curTimeout) { + $sec = (int) floor($this->curTimeout); + $usec = (int) (1000000 * ($this->curTimeout - $sec)); + stream_set_timeout($this->fsock, $sec, $usec); + } $raw = stream_get_contents($this->fsock, $this->decrypt_block_size); if (!strlen($raw)) { @@ -4724,7 +4759,9 @@ class SSH2 } /** - * Returns all errors + * Returns all errors / debug messages on the SSH layer + * + * If you are looking for messages from the SFTP layer, please see SFTP::getSFTPErrors() * * @return string[] */ @@ -4734,7 +4771,9 @@ class SSH2 } /** - * Returns the last error + * Returns the last error received on the SSH layer + * + * If you are looking for messages from the SFTP layer, please see SFTP::getLastSFTPError() * * @return string */ diff --git a/vendor/splitbrain/lesserphp/composer.json b/vendor/splitbrain/lesserphp/composer.json index 27acc6ca0..9b0c40e87 100644 --- a/vendor/splitbrain/lesserphp/composer.json +++ b/vendor/splitbrain/lesserphp/composer.json @@ -41,7 +41,7 @@ "rector/rector": "^0.19" }, "scripts": { - "test": "phpunit --verbose", + "test": "phpunit", "check": "phpcs -p -s", "fix": "phpcbf", "rector": "rector process" diff --git a/vendor/splitbrain/lesserphp/src/Functions/Type.php b/vendor/splitbrain/lesserphp/src/Functions/Type.php index 2e229cecd..9b5e36a78 100644 --- a/vendor/splitbrain/lesserphp/src/Functions/Type.php +++ b/vendor/splitbrain/lesserphp/src/Functions/Type.php @@ -2,6 +2,7 @@ namespace LesserPHP\Functions; +use LesserPHP\Utils\Asserts; use LesserPHP\Utils\Color; use LesserPHP\Utils\Util; @@ -20,12 +21,12 @@ class Type extends AbstractFunctionCollection 'isstring' => [$this, 'isstring'], 'iscolor' => [$this, 'iscolor'], 'iskeyword' => [$this, 'iskeyword'], - //'isurl' => [$this, 'isurl'], + 'isurl' => [$this, 'isurl'], 'ispixel' => [$this, 'ispixel'], 'isem' => [$this, 'isem'], 'isrem' => [$this, 'isrem'], 'ispercentage' => [$this, 'ispercentage'], - //'isunit' => [$this, 'isunit'], + 'isunit' => [$this, 'isunit'], //'isruleset' => [$this, 'isruleset'], //'isdefined' => [$this, 'isdefined'], ]; @@ -72,7 +73,15 @@ class Type extends AbstractFunctionCollection return Util::toBool($value[0] == 'keyword'); } - // isurl is missing + /** + * Returns true if a value is a url, false otherwise + * + * @link https://lesscss.org/functions/#type-functions-isurl + */ + public function isurl(array $value): array + { + return Util::toBool($value[0] == 'function' && $value[1] == 'url'); + } /** * Returns true if a value is a number in pixels, false otherwise @@ -114,7 +123,22 @@ class Type extends AbstractFunctionCollection return Util::toBool($value[0] == 'number' && $value[2] == '%'); } - // isunit is missing + /** + * Returns true if a value is a number with a given unit, false otherwise + * + * @link https://lesscss.org/functions/#type-functions-isunit + */ + public function isunit(array $args): array + { + [$input, $unit] = Asserts::assertArgs($args, 2, 'isunit'); + $unit = $this->lessc->compileValue($this->lessc->unwrap($unit)); + + return Util::toBool( + $input[0] == 'number' && + $input[2] == $unit + ); + } + // isruleset is missing // isdefined is missing } diff --git a/vendor/splitbrain/lesserphp/src/Lessc.php b/vendor/splitbrain/lesserphp/src/Lessc.php index 9780dfb2e..41509eec7 100644 --- a/vendor/splitbrain/lesserphp/src/Lessc.php +++ b/vendor/splitbrain/lesserphp/src/Lessc.php @@ -70,7 +70,7 @@ class Lessc protected ?stdClass $env = null; /** @var stdClass|null The currently parsed block FIXME should probably be its own proper class */ - protected ?stdClass $scope; + protected ?stdClass $scope = null; /** @var array [file => mtime] list of all files that have been parsed, to avoid circular imports */ protected array $allParsedFiles = []; diff --git a/vendor/splitbrain/lesserphp/src/Parser.php b/vendor/splitbrain/lesserphp/src/Parser.php index 420e38356..e9a194164 100644 --- a/vendor/splitbrain/lesserphp/src/Parser.php +++ b/vendor/splitbrain/lesserphp/src/Parser.php @@ -142,7 +142,11 @@ class Parser } if ($this->count != strlen($this->buffer)) { - $this->throwError(); + $this->throwError(sprintf( + "parse error: count mismatches buffer length %d != %d", + $this->count, + strlen($this->buffer) + )); } // TODO report where the block was opened diff --git a/vendor/splitbrain/slika/src/GdAdapter.php b/vendor/splitbrain/slika/src/GdAdapter.php index ad04053e3..af5265625 100644 --- a/vendor/splitbrain/slika/src/GdAdapter.php +++ b/vendor/splitbrain/slika/src/GdAdapter.php @@ -90,13 +90,13 @@ class GdAdapter extends Adapter // rotate if (in_array($orientation, [3, 4])) { - $image = imagerotate($this->image, 180, $transparency, 1); + $image = imagerotate($this->image, 180, $transparency); } if (in_array($orientation, [5, 6])) { - $image = imagerotate($this->image, -90, $transparency, 1); + $image = imagerotate($this->image, -90, $transparency); list($this->width, $this->height) = [$this->height, $this->width]; } elseif (in_array($orientation, [7, 8])) { - $image = imagerotate($this->image, 90, $transparency, 1); + $image = imagerotate($this->image, 90, $transparency); list($this->width, $this->height) = [$this->height, $this->width]; } /** @var resource $image is now defined */ |