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/guzzlehttp | |
| parent | c08d7baf56d5a2b3182f75d237bc83b6860e0646 (diff) | |
| download | webtrees-26c0efaa53fae3c1687c1b9e1ee19ca56feb1627.tar.gz webtrees-26c0efaa53fae3c1687c1b9e1ee19ca56feb1627.tar.bz2 webtrees-26c0efaa53fae3c1687c1b9e1ee19ca56feb1627.zip | |
Update vendor dependencies
Diffstat (limited to 'vendor/guzzlehttp')
| -rw-r--r-- | vendor/guzzlehttp/guzzle/CHANGELOG.md | 11 | ||||
| -rw-r--r-- | vendor/guzzlehttp/guzzle/src/Client.php | 44 | ||||
| -rw-r--r-- | vendor/guzzlehttp/guzzle/src/ClientInterface.php | 2 | ||||
| -rw-r--r-- | vendor/guzzlehttp/guzzle/src/Pool.php | 4 | ||||
| -rw-r--r-- | vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php | 10 | ||||
| -rw-r--r-- | vendor/guzzlehttp/guzzle/src/functions.php | 48 |
6 files changed, 82 insertions, 37 deletions
diff --git a/vendor/guzzlehttp/guzzle/CHANGELOG.md b/vendor/guzzlehttp/guzzle/CHANGELOG.md index 342e0b6c08..a2b61e7128 100644 --- a/vendor/guzzlehttp/guzzle/CHANGELOG.md +++ b/vendor/guzzlehttp/guzzle/CHANGELOG.md @@ -1,6 +1,15 @@ # Change Log -## 6.5.0 - 2019-11-07 +## 6.5.2 - 2019-12-23 + +* idn_to_ascii() fix for old PHP versions [#2489](https://github.com/guzzle/guzzle/pull/2489) + +## 6.5.1 - 2019-12-21 + +* Better defaults for PHP installations with old ICU lib [#2454](https://github.com/guzzle/guzzle/pull/2454) +* IDN support for redirects [#2424](https://github.com/guzzle/guzzle/pull/2424) + +## 6.5.0 - 2019-12-07 * Improvement: Added support for reset internal queue in MockHandler. [#2143](https://github.com/guzzle/guzzle/pull/2143) * Improvement: Added support to pass arbitrary options to `curl_multi_init`. [#2287](https://github.com/guzzle/guzzle/pull/2287) diff --git a/vendor/guzzlehttp/guzzle/src/Client.php b/vendor/guzzlehttp/guzzle/src/Client.php index db4062f942..f2bf20444c 100644 --- a/vendor/guzzlehttp/guzzle/src/Client.php +++ b/vendor/guzzlehttp/guzzle/src/Client.php @@ -102,7 +102,7 @@ class Client implements ClientInterface * @param array $options Request options to apply to the given * request and to the transfer. See \GuzzleHttp\RequestOptions. * - * @return PromiseInterface + * @return Promise\PromiseInterface */ public function sendAsync(RequestInterface $request, array $options = []) { @@ -142,7 +142,7 @@ class Client implements ClientInterface * @param string|UriInterface $uri URI object or string. * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. * - * @return PromiseInterface + * @return Promise\PromiseInterface */ public function requestAsync($method, $uri = '', array $options = []) { @@ -215,36 +215,9 @@ class Client implements ClientInterface $uri = Psr7\UriResolver::resolve(Psr7\uri_for($config['base_uri']), $uri); } - if ($uri->getHost() && isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) { + if (isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) { $idnOptions = ($config['idn_conversion'] === true) ? IDNA_DEFAULT : $config['idn_conversion']; - - $asciiHost = idn_to_ascii($uri->getHost(), $idnOptions, INTL_IDNA_VARIANT_UTS46, $info); - if ($asciiHost === false) { - $errorBitSet = isset($info['errors']) ? $info['errors'] : 0; - - $errorConstants = array_filter(array_keys(get_defined_constants()), function ($name) { - return substr($name, 0, 11) === 'IDNA_ERROR_'; - }); - - $errors = []; - foreach ($errorConstants as $errorConstant) { - if ($errorBitSet & constant($errorConstant)) { - $errors[] = $errorConstant; - } - } - - $errorMessage = 'IDN conversion failed'; - if ($errors) { - $errorMessage .= ' (errors: ' . implode(', ', $errors) . ')'; - } - - throw new InvalidArgumentException($errorMessage); - } else { - if ($uri->getHost() !== $asciiHost) { - // Replace URI only if the ASCII version is different - $uri = $uri->withHost($asciiHost); - } - } + $uri = _idn_uri_convert($uri, $idnOptions); } return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri; @@ -267,7 +240,14 @@ class Client implements ClientInterface ]; // idn_to_ascii() is a part of ext-intl and might be not available - $defaults['idn_conversion'] = function_exists('idn_to_ascii'); + $defaults['idn_conversion'] = function_exists('idn_to_ascii') + // Old ICU versions don't have this constant, so we are basically stuck (see https://github.com/guzzle/guzzle/pull/2424 + // and https://github.com/guzzle/guzzle/issues/2448 for details) + && ( + defined('INTL_IDNA_VARIANT_UTS46') + || + PHP_VERSION_ID < 70200 + ); // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set. diff --git a/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/vendor/guzzlehttp/guzzle/src/ClientInterface.php index 0829b3607a..0c8d42a1e5 100644 --- a/vendor/guzzlehttp/guzzle/src/ClientInterface.php +++ b/vendor/guzzlehttp/guzzle/src/ClientInterface.php @@ -15,7 +15,7 @@ interface ClientInterface /** * @deprecated Will be removed in Guzzle 7.0.0 */ - const VERSION = '6.5.0'; + const VERSION = '6.5.1'; /** * Send an HTTP request. diff --git a/vendor/guzzlehttp/guzzle/src/Pool.php b/vendor/guzzlehttp/guzzle/src/Pool.php index ec7df6c0e0..5838db4f4c 100644 --- a/vendor/guzzlehttp/guzzle/src/Pool.php +++ b/vendor/guzzlehttp/guzzle/src/Pool.php @@ -2,6 +2,7 @@ namespace GuzzleHttp; use GuzzleHttp\Promise\EachPromise; +use GuzzleHttp\Promise\PromiseInterface; use GuzzleHttp\Promise\PromisorInterface; use Psr\Http\Message\RequestInterface; @@ -71,7 +72,8 @@ class Pool implements PromisorInterface /** * Get promise - * @return GuzzleHttp\Promise\Promise + * + * @return PromiseInterface */ public function promise() { diff --git a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php index 5a0edd5728..2f3012618d 100644 --- a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php +++ b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php @@ -13,7 +13,7 @@ use Psr\Http\Message\UriInterface; * Request redirect middleware. * * Apply this middleware like other middleware using - * {@see GuzzleHttp\Middleware::redirect()}. + * {@see \GuzzleHttp\Middleware::redirect()}. */ class RedirectMiddleware { @@ -190,7 +190,13 @@ class RedirectMiddleware $modify['body'] = ''; } - $modify['uri'] = $this->redirectUri($request, $response, $protocols); + $uri = $this->redirectUri($request, $response, $protocols); + if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) { + $idnOptions = ($options['idn_conversion'] === true) ? IDNA_DEFAULT : $options['idn_conversion']; + $uri = _idn_uri_convert($uri, $idnOptions); + } + + $modify['uri'] = $uri; Psr7\rewind_body($request); // Add the Referer header if it is told to do so and only diff --git a/vendor/guzzlehttp/guzzle/src/functions.php b/vendor/guzzlehttp/guzzle/src/functions.php index aff69d557a..5e806f6327 100644 --- a/vendor/guzzlehttp/guzzle/src/functions.php +++ b/vendor/guzzlehttp/guzzle/src/functions.php @@ -1,10 +1,12 @@ <?php namespace GuzzleHttp; +use GuzzleHttp\Exception\InvalidArgumentException; use GuzzleHttp\Handler\CurlHandler; use GuzzleHttp\Handler\CurlMultiHandler; use GuzzleHttp\Handler\Proxy; use GuzzleHttp\Handler\StreamHandler; +use Psr\Http\Message\UriInterface; /** * Expands a URI template @@ -344,3 +346,49 @@ function _current_time() { return function_exists('hrtime') ? hrtime(true) / 1e9 : microtime(true); } + + +/** + * @param int $options + * + * @return UriInterface + * + * @internal + */ +function _idn_uri_convert(UriInterface $uri, $options = 0) +{ + if ($uri->getHost()) { + $idnaVariant = defined('INTL_IDNA_VARIANT_UTS46') ? INTL_IDNA_VARIANT_UTS46 : 0; + $asciiHost = $idnaVariant === 0 + ? idn_to_ascii($uri->getHost(), $options) + : idn_to_ascii($uri->getHost(), $options, $idnaVariant, $info); + if ($asciiHost === false) { + $errorBitSet = isset($info['errors']) ? $info['errors'] : 0; + + $errorConstants = array_filter(array_keys(get_defined_constants()), function ($name) { + return substr($name, 0, 11) === 'IDNA_ERROR_'; + }); + + $errors = []; + foreach ($errorConstants as $errorConstant) { + if ($errorBitSet & constant($errorConstant)) { + $errors[] = $errorConstant; + } + } + + $errorMessage = 'IDN conversion failed'; + if ($errors) { + $errorMessage .= ' (errors: ' . implode(', ', $errors) . ')'; + } + + throw new InvalidArgumentException($errorMessage); + } else { + if ($uri->getHost() !== $asciiHost) { + // Replace URI only if the ASCII version is different + $uri = $uri->withHost($asciiHost); + } + } + } + + return $uri; +} |
