diff options
| author | Greg Roach <fisharebest@gmail.com> | 2020-01-14 13:54:08 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2020-01-14 13:54:08 +0000 |
| commit | 26c0efaa53fae3c1687c1b9e1ee19ca56feb1627 (patch) | |
| tree | 47f27e499ae4543b955daaa9fb61b4a41d283916 /vendor/league | |
| parent | c08d7baf56d5a2b3182f75d237bc83b6860e0646 (diff) | |
| download | webtrees-26c0efaa53fae3c1687c1b9e1ee19ca56feb1627.tar.gz webtrees-26c0efaa53fae3c1687c1b9e1ee19ca56feb1627.tar.bz2 webtrees-26c0efaa53fae3c1687c1b9e1ee19ca56feb1627.zip | |
Update vendor dependencies
Diffstat (limited to 'vendor/league')
19 files changed, 112 insertions, 120 deletions
diff --git a/vendor/league/commonmark/CHANGELOG.md b/vendor/league/commonmark/CHANGELOG.md index 7713f8ff01..eaa424c8a6 100644 --- a/vendor/league/commonmark/CHANGELOG.md +++ b/vendor/league/commonmark/CHANGELOG.md @@ -4,6 +4,13 @@ Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) princi ## [Unreleased][unreleased] +## [1.2.0] - 2020-01-09 + +### Changed + + - Removed URL decoding step before encoding (more performant and better matches the JS library) + - Removed redundant token from HTML tag regex + ## [1.1.2] - 2019-12-09 ### Fixed @@ -180,7 +187,8 @@ No changes were made since 1.0.0-rc1. - Removed `DelimiterStack::iterateByCharacters()` (use the new `processDelimiters()` method instead) - Removed the protected `DelimiterStack::findMatchingOpener()` method -[unreleased]: https://github.com/thephpleague/commonmark/compare/1.1.2...HEAD +[unreleased]: https://github.com/thephpleague/commonmark/compare/1.2.0...HEAD +[1.2.0]: https://github.com/thephpleague/commonmark/compare/1.1.2...1.2.0 [1.1.2]: https://github.com/thephpleague/commonmark/compare/1.1.1...1.1.2 [1.1.1]: https://github.com/thephpleague/commonmark/compare/1.1.0...1.1.1 [1.1.0]: https://github.com/thephpleague/commonmark/compare/1.0.0...1.1.0 diff --git a/vendor/league/commonmark/README.md b/vendor/league/commonmark/README.md index 12df509f47..4732b88c36 100644 --- a/vendor/league/commonmark/README.md +++ b/vendor/league/commonmark/README.md @@ -88,6 +88,8 @@ Custom parsers/renderers can be bundled into extensions which extend CommonMark. - [CommonMark Attributes Extension](https://github.com/webuni/commonmark-attributes-extension) - Adds a syntax to define attributes on the various HTML elements. - [Alt Three Emoji](https://github.com/AltThree/Emoji) An emoji parser for CommonMark. - [Sup Sub extensions](https://github.com/OWS/commonmark-sup-sub-extensions) - Adds support of superscript and subscript (`<sup>` and `<sub>` HTML tags) + - [YouTube iframe extension](https://github.com/zoonru/commonmark-ext-youtube-iframe) - Replaces youtube link with iframe. + - [Footnotes extension](https://github.com/rezozero/commonmark-ext-footnotes) - Adds support for referencing footnotes inline and rendering them at the bottom of your content Others can be found on [Packagist under the `commonmark-extension` package type](https://packagist.org/packages/league/commonmark?type=commonmark-extension). diff --git a/vendor/league/commonmark/composer.json b/vendor/league/commonmark/composer.json index 3c28bd0c1a..8cdc63628f 100644 --- a/vendor/league/commonmark/composer.json +++ b/vendor/league/commonmark/composer.json @@ -29,7 +29,7 @@ "require-dev": { "ext-json": "*", "cebe/markdown": "~1.0", - "commonmark/commonmark.js": "0.29.0", + "commonmark/commonmark.js": "0.29.1", "erusev/parsedown": "~1.0", "michelf/php-markdown": "~1.4", "mikehaertl/php-shellcommand": "^1.4", @@ -46,9 +46,9 @@ "type": "package", "package": { "name": "commonmark/commonmark.js", - "version": "0.29.0", + "version": "0.29.1", "dist": { - "url": "https://github.com/commonmark/commonmark.js/archive/0.29.0.zip", + "url": "https://github.com/commonmark/commonmark.js/archive/0.29.1.zip", "type": "zip" } } @@ -76,7 +76,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "config": { diff --git a/vendor/league/commonmark/src/CommonMarkConverter.php b/vendor/league/commonmark/src/CommonMarkConverter.php index cd14268e12..786ada5bce 100644 --- a/vendor/league/commonmark/src/CommonMarkConverter.php +++ b/vendor/league/commonmark/src/CommonMarkConverter.php @@ -24,7 +24,7 @@ class CommonMarkConverter extends Converter * * This might be a typical `x.y.z` version, or `x.y-dev`. */ - public const VERSION = '1.1.2'; + public const VERSION = '1.2.0'; /** @var EnvironmentInterface */ protected $environment; diff --git a/vendor/league/commonmark/src/Util/RegexHelper.php b/vendor/league/commonmark/src/Util/RegexHelper.php index 86cb3da924..c39d9edcfe 100644 --- a/vendor/league/commonmark/src/Util/RegexHelper.php +++ b/vendor/league/commonmark/src/Util/RegexHelper.php @@ -31,7 +31,7 @@ final class RegexHelper public const PARTIAL_REG_CHAR = '[^\\\\()\x00-\x20]'; public const PARTIAL_IN_PARENS_NOSP = '\((' . self::PARTIAL_REG_CHAR . '|' . self::PARTIAL_ESCAPED_CHAR . '|\\\\)*\)'; public const PARTIAL_TAGNAME = '[A-Za-z][A-Za-z0-9-]*'; - public const PARTIAL_BLOCKTAGNAME = '(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|title|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)'; + public const PARTIAL_BLOCKTAGNAME = '(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)'; public const PARTIAL_ATTRIBUTENAME = '[a-zA-Z_:][a-zA-Z0-9:._-]*'; public const PARTIAL_UNQUOTEDVALUE = '[^"\'=<>`\x00-\x20]+'; public const PARTIAL_SINGLEQUOTEDVALUE = '\'[^\']*\''; @@ -173,7 +173,7 @@ final class RegexHelper case HtmlBlock::TYPE_5_CDATA: return '/^<!\[CDATA\[/'; case HtmlBlock::TYPE_6_BLOCK_ELEMENT: - return '%^<[/]?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[123456]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|title|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|[/]?[>]|$)%i'; + return '%^<[/]?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[123456]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|[/]?[>]|$)%i'; case HtmlBlock::TYPE_7_MISC_ELEMENT: return '/^(?:' . self::PARTIAL_OPENTAG . '|' . self::PARTIAL_CLOSETAG . ')\\s*$/i'; } diff --git a/vendor/league/commonmark/src/Util/UrlEncoder.php b/vendor/league/commonmark/src/Util/UrlEncoder.php index 527fc57277..c7e40ddebb 100644 --- a/vendor/league/commonmark/src/Util/UrlEncoder.php +++ b/vendor/league/commonmark/src/Util/UrlEncoder.php @@ -16,42 +16,7 @@ namespace League\CommonMark\Util; final class UrlEncoder { - protected static $dontEncode = [ - '%21' => '!', - '%23' => '#', - '%24' => '$', - '%26' => '&', - '%27' => '\'', - '%28' => '(', - '%29' => ')', - '%2A' => '*', - '%2B' => '+', - '%2C' => ',', - '%2D' => '-', - '%2E' => '.', - '%2F' => '/', - '%3A' => ':', - '%3B' => ';', - '%3D' => '=', - '%3F' => '?', - '%40' => '@', - '%5F' => '_', - '%7E' => '~', - ]; - - protected static $dontDecode = [ - '%3B' => ';', - '%2F' => '/', - '%3F' => '?', - '%3A' => ':', - '%40' => '@', - '%26' => '&', - '%3D' => '=', - '%2B' => '+', - '%24' => '$', - '%2C' => ',', - '%23' => '#', - ]; + private static $encodeCache = ['%00', '%01', '%02', '%03', '%04', '%05', '%06', '%07', '%08', '%09', '%0A', '%0B', '%0C', '%0D', '%0E', '%0F', '%10', '%11', '%12', '%13', '%14', '%15', '%16', '%17', '%18', '%19', '%1A', '%1B', '%1C', '%1D', '%1E', '%1F', '%20', '!', '%22', '#', '$', '%25', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '%3C', '=', '%3E', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '%5B', '%5C', '%5D', '%5E', '_', '%60', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '%7B', '%7C', '%7D', '~', '%7F']; /** * @param string $uri @@ -60,73 +25,29 @@ final class UrlEncoder */ public static function unescapeAndEncode(string $uri): string { - $decoded = \html_entity_decode($uri); - - return self::encode(self::decode($decoded)); - } - - /** - * Decode a percent-encoded URI - * - * @param string $uri - * - * @return string - */ - private static function decode(string $uri): string - { - /** @var string $ret */ - $ret = \preg_replace_callback('/((?:%[0-9a-f]{2})+)/iu', function ($matches) { - $bytes = \hex2bin(\str_replace('%', '', $matches[1])); - - // Invalid UTF-8 sequences should be kept as-is - if ($bytes === false || !\mb_check_encoding($bytes, 'UTF-8')) { - return \strtoupper($matches[0]); - } + $result = ''; - // Otherwise, split the sequence into characters and decode them (unless that character shouldn't be decoded) - /** @var string[] $characters */ - $characters = \preg_split('//u', $bytes, -1, \PREG_SPLIT_NO_EMPTY); - - $ret = ''; - foreach ($characters as $char) { - if (($encoding = \array_search($char, self::$dontDecode, true)) !== false) { - $ret .= $encoding; - } else { - $ret .= $char; + /** @var string[] $chars */ + $chars = \preg_split('//u', $uri, -1, \PREG_SPLIT_NO_EMPTY); + $l = \count($chars); + for ($i = 0; $i < $l; $i++) { + $code = $chars[$i]; + if ($code === '%' && $i + 2 < $l) { + if (\preg_match('/^[0-9a-f]{2}$/i', $chars[$i + 1] . $chars[$i + 2]) === 1) { + $result .= '%' . $chars[$i + 1] . $chars[$i + 2]; + $i += 2; + continue; } } - return $ret; - }, $uri); - - return $ret; - } - - /** - * Encode a URI, preserving already-encoded and excluded characters - * - * @param string $uri - * - * @return string - */ - private static function encode(string $uri): string - { - /** @var string $ret */ - $ret = \preg_replace_callback('/(%[0-9a-f]{2})|./isu', function ($matches) { - // Keep already-encoded characters as-is - if (\count($matches) > 1) { - return $matches[0]; - } - - // Keep excluded characters as-is - if (\in_array($matches[0], self::$dontEncode)) { - return $matches[0]; + if (\ord($code) < 128) { + $result .= self::$encodeCache[\ord($code)]; + continue; } - // Otherwise, encode the character - return \rawurlencode($matches[0]); - }, $uri); + $result .= \rawurlencode($code); + } - return $ret; + return $result; } } diff --git a/vendor/league/flysystem/SECURITY.md b/vendor/league/flysystem/SECURITY.md new file mode 100644 index 0000000000..f5b205ed08 --- /dev/null +++ b/vendor/league/flysystem/SECURITY.md @@ -0,0 +1,16 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| 1.0.x | :white_check_mark: | +| 2.0.x | :x: | + +## Reporting a Vulnerability + +When you've encountered a security vulnerability, please disclose it securely. + +The security process is described at: +[https://flysystem.thephpleague.com/docs/security/](https://flysystem.thephpleague.com/docs/security/) + diff --git a/vendor/league/flysystem/composer.json b/vendor/league/flysystem/composer.json index 84229e9ff7..92ab3889eb 100644 --- a/vendor/league/flysystem/composer.json +++ b/vendor/league/flysystem/composer.json @@ -1,5 +1,6 @@ { "name": "league/flysystem", + "type": "library", "description": "Filesystem abstraction: Many filesystems, one API.", "keywords": [ "filesystem", "filesystems", "files", "storage", "dropbox", "aws", diff --git a/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php b/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php index 578b49190a..fb8aa49cfa 100644 --- a/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php +++ b/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php @@ -557,6 +557,10 @@ abstract class AbstractFtpAdapter extends AbstractAdapter */ protected function normalizePermissions($permissions) { + if (is_numeric($permissions)) { + return $permissions & 0777; + } + // remove the type identifier $permissions = substr($permissions, 1); diff --git a/vendor/league/flysystem/src/Adapter/Ftp.php b/vendor/league/flysystem/src/Adapter/Ftp.php index c984824320..cdaf711b21 100644 --- a/vendor/league/flysystem/src/Adapter/Ftp.php +++ b/vendor/league/flysystem/src/Adapter/Ftp.php @@ -6,9 +6,11 @@ use ErrorException; use League\Flysystem\Adapter\Polyfill\StreamedCopyTrait; use League\Flysystem\AdapterInterface; use League\Flysystem\Config; +use League\Flysystem\ConnectionErrorException; +use League\Flysystem\ConnectionRuntimeException; +use League\Flysystem\InvalidRootException; use League\Flysystem\Util; use League\Flysystem\Util\MimeType; -use RuntimeException; class Ftp extends AbstractFtpAdapter { @@ -135,7 +137,7 @@ class Ftp extends AbstractFtpAdapter } if ( ! $this->connection) { - throw new RuntimeException('Could not connect to host: ' . $this->getHost() . ', port:' . $this->getPort()); + throw new ConnectionRuntimeException('Could not connect to host: ' . $this->getHost() . ', port:' . $this->getPort()); } $this->login(); @@ -153,7 +155,7 @@ class Ftp extends AbstractFtpAdapter if ($this->utf8) { $response = ftp_raw($this->connection, "OPTS UTF8 ON"); if (substr($response[0], 0, 3) !== '200') { - throw new RuntimeException( + throw new ConnectionRuntimeException( 'Could not set UTF-8 mode for connection: ' . $this->getHost() . '::' . $this->getPort() ); } @@ -163,7 +165,7 @@ class Ftp extends AbstractFtpAdapter /** * Set the connections to passive mode. * - * @throws RuntimeException + * @throws ConnectionRuntimeException */ protected function setConnectionPassiveMode() { @@ -172,7 +174,7 @@ class Ftp extends AbstractFtpAdapter } if ( ! ftp_pasv($this->connection, $this->passive)) { - throw new RuntimeException( + throw new ConnectionRuntimeException( 'Could not set passive mode for connection: ' . $this->getHost() . '::' . $this->getPort() ); } @@ -187,7 +189,7 @@ class Ftp extends AbstractFtpAdapter $connection = $this->connection; if ($root && ! ftp_chdir($connection, $root)) { - throw new RuntimeException('Root is invalid or does not exist: ' . $this->getRoot()); + throw new InvalidRootException('Root is invalid or does not exist: ' . $this->getRoot()); } // Store absolute path for further reference. @@ -200,7 +202,7 @@ class Ftp extends AbstractFtpAdapter /** * Login. * - * @throws RuntimeException + * @throws ConnectionRuntimeException */ protected function login() { @@ -215,7 +217,7 @@ class Ftp extends AbstractFtpAdapter if ( ! $isLoggedIn) { $this->disconnect(); - throw new RuntimeException( + throw new ConnectionRuntimeException( 'Could not login with connection: ' . $this->getHost() . '::' . $this->getPort( ) . ', username: ' . $this->getUsername() ); @@ -526,7 +528,7 @@ class Ftp extends AbstractFtpAdapter * * @return bool * - * @throws ErrorException + * @throws ConnectionErrorException */ public function isConnected() { @@ -534,7 +536,7 @@ class Ftp extends AbstractFtpAdapter return is_resource($this->connection) && ftp_rawlist($this->connection, $this->getRoot()) !== false; } catch (ErrorException $e) { if (strpos($e->getMessage(), 'ftp_rawlist') === false) { - throw $e; + throw new ConnectionErrorException($e->getMessage()); } return false; diff --git a/vendor/league/flysystem/src/ConnectionErrorException.php b/vendor/league/flysystem/src/ConnectionErrorException.php new file mode 100644 index 0000000000..adb651d3db --- /dev/null +++ b/vendor/league/flysystem/src/ConnectionErrorException.php @@ -0,0 +1,9 @@ +<?php + +namespace League\Flysystem; + +use ErrorException; + +class ConnectionErrorException extends ErrorException implements FilesystemException +{ +} diff --git a/vendor/league/flysystem/src/ConnectionRuntimeException.php b/vendor/league/flysystem/src/ConnectionRuntimeException.php new file mode 100644 index 0000000000..8b893ef17a --- /dev/null +++ b/vendor/league/flysystem/src/ConnectionRuntimeException.php @@ -0,0 +1,9 @@ +<?php + +namespace League\Flysystem; + +use RuntimeException; + +class ConnectionRuntimeException extends RuntimeException implements FilesystemException +{ +} diff --git a/vendor/league/flysystem/src/Exception.php b/vendor/league/flysystem/src/Exception.php index d4a9907b4a..4596c0a9a9 100644 --- a/vendor/league/flysystem/src/Exception.php +++ b/vendor/league/flysystem/src/Exception.php @@ -2,7 +2,7 @@ namespace League\Flysystem; -class Exception extends \Exception +class Exception extends \Exception implements FilesystemException { // } diff --git a/vendor/league/flysystem/src/FilesystemException.php b/vendor/league/flysystem/src/FilesystemException.php new file mode 100644 index 0000000000..3121e533d7 --- /dev/null +++ b/vendor/league/flysystem/src/FilesystemException.php @@ -0,0 +1,7 @@ +<?php + +namespace League\Flysystem; + +interface FilesystemException +{ +} diff --git a/vendor/league/flysystem/src/FilesystemNotFoundException.php b/vendor/league/flysystem/src/FilesystemNotFoundException.php index 0c16aa0198..f928fa1d03 100644 --- a/vendor/league/flysystem/src/FilesystemNotFoundException.php +++ b/vendor/league/flysystem/src/FilesystemNotFoundException.php @@ -7,6 +7,6 @@ use LogicException; /** * Thrown when the MountManager cannot find a filesystem. */ -class FilesystemNotFoundException extends LogicException +class FilesystemNotFoundException extends LogicException implements FilesystemException { } diff --git a/vendor/league/flysystem/src/InvalidRootException.php b/vendor/league/flysystem/src/InvalidRootException.php new file mode 100644 index 0000000000..468d1d58c1 --- /dev/null +++ b/vendor/league/flysystem/src/InvalidRootException.php @@ -0,0 +1,9 @@ +<?php + +namespace League\Flysystem; + +use RuntimeException; + +class InvalidRootException extends RuntimeException implements FilesystemException +{ +} diff --git a/vendor/league/flysystem/src/NotSupportedException.php b/vendor/league/flysystem/src/NotSupportedException.php index 08f47f7495..e0a989b22c 100644 --- a/vendor/league/flysystem/src/NotSupportedException.php +++ b/vendor/league/flysystem/src/NotSupportedException.php @@ -5,7 +5,7 @@ namespace League\Flysystem; use RuntimeException; use SplFileInfo; -class NotSupportedException extends RuntimeException +class NotSupportedException extends RuntimeException implements FilesystemException { /** * Create a new exception for a link. diff --git a/vendor/league/flysystem/src/RootViolationException.php b/vendor/league/flysystem/src/RootViolationException.php index 1f2a63d89b..073fc92b43 100644 --- a/vendor/league/flysystem/src/RootViolationException.php +++ b/vendor/league/flysystem/src/RootViolationException.php @@ -4,7 +4,7 @@ namespace League\Flysystem; use LogicException; -class RootViolationException extends LogicException +class RootViolationException extends LogicException implements FilesystemException { // } diff --git a/vendor/league/flysystem/src/Util.php b/vendor/league/flysystem/src/Util.php index 9de37775f4..76454a05ea 100644 --- a/vendor/league/flysystem/src/Util.php +++ b/vendor/league/flysystem/src/Util.php @@ -267,12 +267,16 @@ class Util * * @param resource $resource * - * @return int stream size + * @return int|null stream size */ public static function getStreamSize($resource) { $stat = fstat($resource); + if ( ! is_array($stat) || ! isset($stat['size'])) { + return null; + } + return $stat['size']; } |
