diff options
Diffstat (limited to 'vendor/sabre')
-rw-r--r-- | vendor/sabre/http/CHANGELOG.md | 21 | ||||
-rw-r--r-- | vendor/sabre/http/lib/Client.php | 5 | ||||
-rw-r--r-- | vendor/sabre/http/lib/Sapi.php | 6 | ||||
-rw-r--r-- | vendor/sabre/http/lib/Version.php | 2 | ||||
-rw-r--r-- | vendor/sabre/uri/composer.json | 14 | ||||
-rw-r--r-- | vendor/sabre/uri/lib/Version.php | 2 | ||||
-rw-r--r-- | vendor/sabre/uri/lib/functions.php | 79 | ||||
-rw-r--r-- | vendor/sabre/xml/lib/Deserializer/functions.php | 2 | ||||
-rw-r--r-- | vendor/sabre/xml/lib/Version.php | 2 |
9 files changed, 39 insertions, 94 deletions
diff --git a/vendor/sabre/http/CHANGELOG.md b/vendor/sabre/http/CHANGELOG.md index 7c6f4b6ec..2dddce4fb 100644 --- a/vendor/sabre/http/CHANGELOG.md +++ b/vendor/sabre/http/CHANGELOG.md @@ -1,27 +1,6 @@ ChangeLog ========= -5.1.10 (2023-08-18) ------------------- - -* #225 Enhance tests/bootstrap.php to find autoloader in more environments (@phil-davis) - -5.1.9 (2023-08-17) ------------------- - -* #223 skip testParseMimeTypeOnInvalidMimeType (@phil-davis) - -5.1.8 (2023-08-17) ------------------- - -* #215 Improve CURLOPT_HTTPHEADER Setting Assignment (@amrita-shrestha) - -5.1.7 (2023-06-26) ------------------- - -* #98 and #176 Add more tests (@peter279k) -* #207 fix: handle client disconnect properly with ignore_user_abort true (@kesselb) - 5.1.6 (2022-07-15) ------------------ diff --git a/vendor/sabre/http/lib/Client.php b/vendor/sabre/http/lib/Client.php index 0837e8d2a..2bc7483a7 100644 --- a/vendor/sabre/http/lib/Client.php +++ b/vendor/sabre/http/lib/Client.php @@ -402,10 +402,7 @@ class Client extends EventEmitter $nHeaders[] = $key.': '.$value; } } - - if ([] !== $nHeaders) { - $settings[CURLOPT_HTTPHEADER] = $nHeaders; - } + $settings[CURLOPT_HTTPHEADER] = $nHeaders; $settings[CURLOPT_URL] = $request->getUrl(); // FIXME: CURLOPT_PROTOCOLS is currently unsupported by HHVM if (defined('CURLOPT_PROTOCOLS')) { diff --git a/vendor/sabre/http/lib/Sapi.php b/vendor/sabre/http/lib/Sapi.php index 55a4c46e7..f8e8397fc 100644 --- a/vendor/sabre/http/lib/Sapi.php +++ b/vendor/sabre/http/lib/Sapi.php @@ -115,12 +115,6 @@ class Sapi if ($copied <= 0) { break; } - // Abort on client disconnect. - // With ignore_user_abort(true), the script is not aborted on client disconnect. - // To avoid reading the entire stream and dismissing the data afterward, check between the chunks if the client is still there. - if (1 === ignore_user_abort() && 1 === connection_aborted()) { - break; - } $left -= $copied; } } else { diff --git a/vendor/sabre/http/lib/Version.php b/vendor/sabre/http/lib/Version.php index 93c64797b..47582f22e 100644 --- a/vendor/sabre/http/lib/Version.php +++ b/vendor/sabre/http/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - const VERSION = '5.1.10'; + const VERSION = '5.1.6'; } diff --git a/vendor/sabre/uri/composer.json b/vendor/sabre/uri/composer.json index 03c33877c..0e0cf2d36 100644 --- a/vendor/sabre/uri/composer.json +++ b/vendor/sabre/uri/composer.json @@ -37,12 +37,9 @@ } }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.17", - "phpstan/phpstan": "^1.10", - "phpstan/phpstan-phpunit": "^1.3", - "phpstan/phpstan-strict-rules": "^1.5", - "phpstan/extension-installer": "^1.3", - "phpunit/phpunit" : "^9.6" + "friendsofphp/php-cs-fixer": "^3.9", + "phpstan/phpstan": "^1.8", + "phpunit/phpunit" : "^9.0" }, "scripts": { "phpstan": [ @@ -59,10 +56,5 @@ "composer cs-fixer", "composer phpunit" ] - }, - "config": { - "allow-plugins": { - "phpstan/extension-installer": true - } } } diff --git a/vendor/sabre/uri/lib/Version.php b/vendor/sabre/uri/lib/Version.php index a30694f2c..e4f289e90 100644 --- a/vendor/sabre/uri/lib/Version.php +++ b/vendor/sabre/uri/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - public const VERSION = '2.3.3'; + public const VERSION = '2.3.2'; } diff --git a/vendor/sabre/uri/lib/functions.php b/vendor/sabre/uri/lib/functions.php index 01ef92d7e..64e64027f 100644 --- a/vendor/sabre/uri/lib/functions.php +++ b/vendor/sabre/uri/lib/functions.php @@ -26,15 +26,15 @@ function resolve(string $basePath, string $newPath): string // If the new path defines a scheme, it's absolute and we can just return // that. - if (null !== $delta['scheme']) { + if ($delta['scheme']) { return build($delta); } $base = parse($basePath); $pick = function ($part) use ($base, $delta) { - if (null !== $delta[$part]) { + if ($delta[$part]) { return $delta[$part]; - } elseif (null !== $base[$part]) { + } elseif ($base[$part]) { return $base[$part]; } @@ -47,6 +47,7 @@ function resolve(string $basePath, string $newPath): string $newParts['host'] = $pick('host'); $newParts['port'] = $pick('port'); + $path = ''; if (is_string($delta['path']) and strlen($delta['path']) > 0) { // If the path starts with a slash if ('/' === $delta['path'][0]) { @@ -61,10 +62,7 @@ function resolve(string $basePath, string $newPath): string $path .= '/'.$delta['path']; } } else { - $path = $base['path'] ?? '/'; - if ('' === $path) { - $path = '/'; - } + $path = $base['path'] ?: '/'; } // Removing .. and . $pathParts = explode('/', $path); @@ -87,17 +85,13 @@ function resolve(string $basePath, string $newPath): string // If the source url ended with a /, we want to preserve that. $newParts['path'] = 0 === strpos($path, '/') ? $path : '/'.$path; - // From PHP 8, no "?" query at all causes 'query' to be null. - // An empty query "http://example.com/foo?" causes 'query' to be the empty string - if (null !== $delta['query'] && '' !== $delta['query']) { + if ($delta['query']) { $newParts['query'] = $delta['query']; - } elseif (isset($base['query']) && null === $delta['host'] && null === $delta['path']) { + } elseif (!empty($base['query']) && empty($delta['host']) && empty($delta['path'])) { // Keep the old query if host and path didn't change $newParts['query'] = $base['query']; } - // From PHP 8, no "#" fragment at all causes 'fragment' to be null. - // An empty fragment "http://example.com/foo#" causes 'fragment' to be the empty string - if (null !== $delta['fragment'] && '' !== $delta['fragment']) { + if ($delta['fragment']) { $newParts['fragment'] = $delta['fragment']; } @@ -119,7 +113,7 @@ function normalize(string $uri): string { $parts = parse($uri); - if (null !== $parts['path']) { + if (!empty($parts['path'])) { $pathParts = explode('/', ltrim($parts['path'], '/')); $newPathParts = []; foreach ($pathParts as $pathPart) { @@ -140,14 +134,14 @@ function normalize(string $uri): string $parts['path'] = '/'.implode('/', $newPathParts); } - if (null !== $parts['scheme']) { + if ($parts['scheme']) { $parts['scheme'] = strtolower($parts['scheme']); $defaultPorts = [ 'http' => '80', 'https' => '443', ]; - if (null !== $parts['port'] && isset($defaultPorts[$parts['scheme']]) && $defaultPorts[$parts['scheme']] == $parts['port']) { + if (!empty($parts['port']) && isset($defaultPorts[$parts['scheme']]) && $defaultPorts[$parts['scheme']] == $parts['port']) { // Removing default ports. unset($parts['port']); } @@ -155,7 +149,7 @@ function normalize(string $uri): string switch ($parts['scheme']) { case 'http': case 'https': - if (null === $parts['path']) { + if (empty($parts['path'])) { // An empty path is equivalent to / in http. $parts['path'] = '/'; } @@ -163,7 +157,7 @@ function normalize(string $uri): string } } - if (null !== $parts['host']) { + if ($parts['host']) { $parts['host'] = strtolower($parts['host']); } @@ -207,7 +201,7 @@ function parse(string $uri): array } $result = parse_url($uri); - if (false === $result) { + if (!$result) { $result = _parse_fallback($uri); } @@ -244,32 +238,32 @@ function build(array $parts): string $uri = ''; $authority = ''; - if (isset($parts['host'])) { + if (!empty($parts['host'])) { $authority = $parts['host']; - if (isset($parts['user'])) { + if (!empty($parts['user'])) { $authority = $parts['user'].'@'.$authority; } - if (isset($parts['port'])) { + if (!empty($parts['port'])) { $authority = $authority.':'.$parts['port']; } } - if (isset($parts['scheme'])) { + if (!empty($parts['scheme'])) { // If there's a scheme, there's also a host. $uri = $parts['scheme'].':'; } - if ('' !== $authority || (isset($parts['scheme']) && 'file' === $parts['scheme'])) { + if ($authority || (!empty($parts['scheme']) && 'file' === $parts['scheme'])) { // No scheme, but there is a host. $uri .= '//'.$authority; } - if (isset($parts['path'])) { + if (!empty($parts['path'])) { $uri .= $parts['path']; } - if (isset($parts['query'])) { + if (!empty($parts['query'])) { $uri .= '?'.$parts['query']; } - if (isset($parts['fragment'])) { + if (!empty($parts['fragment'])) { $uri .= '#'.$parts['fragment']; } @@ -296,7 +290,7 @@ function build(array $parts): string function split(string $path): array { $matches = []; - if (1 === preg_match('/^(?:(?:(.*)(?:\/+))?([^\/]+))(?:\/?)$/u', $path, $matches)) { + if (preg_match('/^(?:(?:(.*)(?:\/+))?([^\/]+))(?:\/?)$/u', $path, $matches)) { return [$matches[1], $matches[2]]; } @@ -313,7 +307,7 @@ function split(string $path): array * This function is only called if the main parse method fails. It's pretty * crude and probably slow, so the original parse_url is usually preferred. * - * @return array{scheme: string|null, host: string|null, path: string|null, port: positive-int|null, user: string|null, query: string|null, fragment: string|null} + * @return array<string, mixed> * * @throws InvalidUriException */ @@ -346,14 +340,10 @@ function _parse_fallback(string $uri): array 'query' => null, ]; - if (1 === preg_match('% ^([A-Za-z][A-Za-z0-9+-\.]+): %x', $uri, $matches)) { + if (preg_match('% ^([A-Za-z][A-Za-z0-9+-\.]+): %x', $uri, $matches)) { $result['scheme'] = $matches[1]; // Take what's left. $uri = substr($uri, strlen($result['scheme']) + 1); - if (false === $uri) { - // There was nothing left. - $uri = ''; - } } // Taking off a fragment part @@ -368,11 +358,7 @@ function _parse_fallback(string $uri): array if ('///' === substr($uri, 0, 3)) { // The triple slash uris are a bit unusual, but we have special handling // for them. - $path = substr($uri, 2); - if (false === $path) { - throw new \RuntimeException('The string cannot be false'); - } - $result['path'] = $path; + $result['path'] = substr($uri, 2); $result['host'] = ''; } elseif ('//' === substr($uri, 0, 2)) { // Uris that have an authority part. @@ -383,25 +369,22 @@ function _parse_fallback(string $uri): array (?: : (?<port> [0-9]+))? (?<path> / .*)? $%x'; - if (1 !== preg_match($regex, $uri, $matches)) { + if (!preg_match($regex, $uri, $matches)) { throw new InvalidUriException('Invalid, or could not parse URI'); } - if (isset($matches['host']) && '' !== $matches['host']) { + if ($matches['host']) { $result['host'] = $matches['host']; } if (isset($matches['port'])) { - $port = (int) $matches['port']; - if ($port > 0) { - $result['port'] = $port; - } + $result['port'] = (int) $matches['port']; } if (isset($matches['path'])) { $result['path'] = $matches['path']; } - if (isset($matches['user']) && '' !== $matches['user']) { + if ($matches['user']) { $result['user'] = $matches['user']; } - if (isset($matches['pass']) && '' !== $matches['pass']) { + if ($matches['pass']) { $result['pass'] = $matches['pass']; } } else { diff --git a/vendor/sabre/xml/lib/Deserializer/functions.php b/vendor/sabre/xml/lib/Deserializer/functions.php index 62d4d0e07..c4f240970 100644 --- a/vendor/sabre/xml/lib/Deserializer/functions.php +++ b/vendor/sabre/xml/lib/Deserializer/functions.php @@ -216,7 +216,7 @@ function valueObject(Reader $reader, string $className, string $namespace) $reader->next(); } } else { - if (Reader::END_ELEMENT !== $reader->nodeType && !$reader->read()) { + if (!$reader->read()) { break; } } diff --git a/vendor/sabre/xml/lib/Version.php b/vendor/sabre/xml/lib/Version.php index 6b6c53b18..1144bf085 100644 --- a/vendor/sabre/xml/lib/Version.php +++ b/vendor/sabre/xml/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - const VERSION = '2.2.6'; + const VERSION = '2.2.5'; } |