From 2ce93c47e87ae976775b4ea588ef710b47eefe22 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Fri, 1 Sep 2023 11:33:44 +0100 Subject: [PATCH] Replaced all insecure/redirecting links --- README.md | 14 +++++++------- src/InflateStream.php | 8 ++++---- src/Message.php | 8 ++++---- src/MessageTrait.php | 6 +++--- src/Request.php | 2 +- src/Stream.php | 4 ++-- src/Uri.php | 18 +++++++++--------- src/UriNormalizer.php | 6 +++--- src/UriResolver.php | 6 +++--- 9 files changed, 36 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index a64ec904..4c7cbaa5 100644 --- a/README.md +++ b/README.md @@ -637,7 +637,7 @@ this library also provides additional functionality when working with URIs as st An instance of `Psr\Http\Message\UriInterface` can either be an absolute URI or a relative reference. An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI, the base URI. Relative references can be divided into several forms according to -[RFC 3986 Section 4.2](https://tools.ietf.org/html/rfc3986#section-4.2): +[RFC 3986 Section 4.2](https://datatracker.ietf.org/doc/html/rfc3986#section-4.2): - network-path references, e.g. `//example.com/path` - absolute-path references, e.g. `/path` @@ -696,8 +696,8 @@ or the standard port. This method can be used independently of the implementatio `public static function composeComponents($scheme, $authority, $path, $query, $fragment): string` Composes a URI reference string from its various components according to -[RFC 3986 Section 5.3](https://tools.ietf.org/html/rfc3986#section-5.3). Usually this method does not need to be called -manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`. +[RFC 3986 Section 5.3](https://datatracker.ietf.org/doc/html/rfc3986#section-5.3). Usually this method does not need +to be called manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`. ### `GuzzleHttp\Psr7\Uri::fromParts` @@ -741,8 +741,8 @@ Determines if a modified URL should be considered cross-origin with respect to a ## Reference Resolution `GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according -to [RFC 3986 Section 5](https://tools.ietf.org/html/rfc3986#section-5). This is for example also what web browsers -do when resolving a link in a website based on the current request URI. +to [RFC 3986 Section 5](https://datatracker.ietf.org/doc/html/rfc3986#section-5). This is for example also what web +browsers do when resolving a link in a website based on the current request URI. ### `GuzzleHttp\Psr7\UriResolver::resolve` @@ -755,7 +755,7 @@ Converts the relative URI into a new URI that is resolved against the base URI. `public static function removeDotSegments(string $path): string` Removes dot segments from a path and returns the new path according to -[RFC 3986 Section 5.2.4](https://tools.ietf.org/html/rfc3986#section-5.2.4). +[RFC 3986 Section 5.2.4](https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4). ### `GuzzleHttp\Psr7\UriResolver::relativize` @@ -781,7 +781,7 @@ echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // pr ## Normalization and Comparison `GuzzleHttp\Psr7\UriNormalizer` provides methods to normalize and compare URIs according to -[RFC 3986 Section 6](https://tools.ietf.org/html/rfc3986#section-6). +[RFC 3986 Section 6](https://datatracker.ietf.org/doc/html/rfc3986#section-6). ### `GuzzleHttp\Psr7\UriNormalizer::normalize` diff --git a/src/InflateStream.php b/src/InflateStream.php index 599b55da..e674c9ab 100644 --- a/src/InflateStream.php +++ b/src/InflateStream.php @@ -13,9 +13,9 @@ * then appends the zlib.inflate filter. The stream is then converted back * to a Guzzle stream resource to be used as a Guzzle stream. * - * @see http://tools.ietf.org/html/rfc1950 - * @see http://tools.ietf.org/html/rfc1952 - * @see http://php.net/manual/en/filters.compression.php + * @see https://datatracker.ietf.org/doc/html/rfc1950 + * @see https://datatracker.ietf.org/doc/html/rfc1952 + * @see https://www.php.net/manual/en/filters.compression.php */ final class InflateStream implements StreamInterface { @@ -28,7 +28,7 @@ public function __construct(StreamInterface $stream) { $resource = StreamWrapper::getResource($stream); // Specify window=15+32, so zlib will use header detection to both gzip (with header) and zlib data - // See http://www.zlib.net/manual.html#Advanced definition of inflateInit2 + // See https://www.zlib.net/manual.html#Advanced definition of inflateInit2 // "Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection" // Default window size is 15. stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ, ['window' => 15 + 32]); diff --git a/src/Message.php b/src/Message.php index 6e6c3e51..5561a513 100644 --- a/src/Message.php +++ b/src/Message.php @@ -146,7 +146,7 @@ public static function parseMessage(string $message): array // If these aren't the same, then one line didn't match and there's an invalid header. if ($count !== substr_count($rawHeaders, "\n")) { - // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4 + // Folding is deprecated, see https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4 if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) { throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding'); } @@ -227,9 +227,9 @@ public static function parseRequest(string $message): RequestInterface public static function parseResponse(string $message): ResponseInterface { $data = self::parseMessage($message); - // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space - // between status-code and reason-phrase is required. But browsers accept - // responses without space and reason as well. + // According to https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2 + // the space between status-code and reason-phrase is required. But + // browsers accept responses without space and reason as well. if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) { throw new \InvalidArgumentException('Invalid response string: '.$data['start-line']); } diff --git a/src/MessageTrait.php b/src/MessageTrait.php index e05ebea8..e0dd0d0f 100644 --- a/src/MessageTrait.php +++ b/src/MessageTrait.php @@ -193,7 +193,7 @@ private function normalizeHeaderValue($value): array * * @return string[] Trimmed header values * - * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 + * @see https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4 */ private function trimAndValidateHeaderValues(array $values): array { @@ -213,7 +213,7 @@ private function trimAndValidateHeaderValues(array $values): array } /** - * @see https://tools.ietf.org/html/rfc7230#section-3.2 + * @see https://datatracker.ietf.org/doc/html/rfc7230#section-3.2 * * @param mixed $header */ @@ -234,7 +234,7 @@ private function assertHeader($header): void } /** - * @see https://tools.ietf.org/html/rfc7230#section-3.2 + * @see https://datatracker.ietf.org/doc/html/rfc7230#section-3.2 * * field-value = *( field-content / obs-fold ) * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] diff --git a/src/Request.php b/src/Request.php index db29d95d..7b39cae1 100644 --- a/src/Request.php +++ b/src/Request.php @@ -143,7 +143,7 @@ private function updateHostFromUri(): void $this->headerNames['host'] = 'Host'; } // Ensure Host is the first header. - // See: http://tools.ietf.org/html/rfc7230#section-5.4 + // See: https://datatracker.ietf.org/doc/html/rfc7230#section-5.4 $this->headers = [$header => [$host]] + $this->headers; } diff --git a/src/Stream.php b/src/Stream.php index f730ddac..0aff9b2b 100644 --- a/src/Stream.php +++ b/src/Stream.php @@ -12,8 +12,8 @@ class Stream implements StreamInterface { /** - * @see http://php.net/manual/function.fopen.php - * @see http://php.net/manual/en/function.gzopen.php + * @see https://www.php.net/manual/en/function.fopen.php + * @see https://www.php.net/manual/en/function.gzopen.php */ private const READABLE_MODES = '/r|a\+|ab\+|w\+|wb\+|x\+|xb\+|c\+|cb\+/'; private const WRITABLE_MODES = '/a|w|r\+|rb\+|rw|x|c/'; diff --git a/src/Uri.php b/src/Uri.php index fbba7f12..553f2993 100644 --- a/src/Uri.php +++ b/src/Uri.php @@ -41,14 +41,14 @@ class Uri implements UriInterface, \JsonSerializable /** * Unreserved characters for use in a regex. * - * @see https://tools.ietf.org/html/rfc3986#section-2.3 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-2.3 */ private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~'; /** * Sub-delims for use in a regex. * - * @see https://tools.ietf.org/html/rfc3986#section-2.2 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-2.2 */ private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='; private const QUERY_SEPARATORS_REPLACEMENT = ['=' => '%3D', '&' => '%26']; @@ -162,7 +162,7 @@ public function __toString(): string * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to * that format). * - * @see https://tools.ietf.org/html/rfc3986#section-5.3 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.3 */ public static function composeComponents(?string $scheme, ?string $authority, string $path, ?string $query, ?string $fragment): string { @@ -219,7 +219,7 @@ public static function isDefaultPort(UriInterface $uri): bool * @see Uri::isNetworkPathReference * @see Uri::isAbsolutePathReference * @see Uri::isRelativePathReference - * @see https://tools.ietf.org/html/rfc3986#section-4 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4 */ public static function isAbsolute(UriInterface $uri): bool { @@ -231,7 +231,7 @@ public static function isAbsolute(UriInterface $uri): bool * * A relative reference that begins with two slash characters is termed an network-path reference. * - * @see https://tools.ietf.org/html/rfc3986#section-4.2 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.2 */ public static function isNetworkPathReference(UriInterface $uri): bool { @@ -243,7 +243,7 @@ public static function isNetworkPathReference(UriInterface $uri): bool * * A relative reference that begins with a single slash character is termed an absolute-path reference. * - * @see https://tools.ietf.org/html/rfc3986#section-4.2 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.2 */ public static function isAbsolutePathReference(UriInterface $uri): bool { @@ -258,7 +258,7 @@ public static function isAbsolutePathReference(UriInterface $uri): bool * * A relative reference that does not begin with a slash character is termed a relative-path reference. * - * @see https://tools.ietf.org/html/rfc3986#section-4.2 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.2 */ public static function isRelativePathReference(UriInterface $uri): bool { @@ -277,7 +277,7 @@ public static function isRelativePathReference(UriInterface $uri): bool * @param UriInterface $uri The URI to check * @param UriInterface|null $base An optional base URI to compare against * - * @see https://tools.ietf.org/html/rfc3986#section-4.4 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.4 */ public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool { @@ -353,7 +353,7 @@ public static function withQueryValues(UriInterface $uri, array $keyValueArray): /** * Creates a URI from a hash of `parse_url` components. * - * @see http://php.net/manual/en/function.parse-url.php + * @see https://www.php.net/manual/en/function.parse-url.php * * @throws MalformedUriException If the components do not form a valid URI. */ diff --git a/src/UriNormalizer.php b/src/UriNormalizer.php index cd4c383a..08ceaab3 100644 --- a/src/UriNormalizer.php +++ b/src/UriNormalizer.php @@ -11,7 +11,7 @@ * * @author Tobias Schultze * - * @see https://tools.ietf.org/html/rfc3986#section-6 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-6 */ final class UriNormalizer { @@ -119,7 +119,7 @@ final class UriNormalizer * @param UriInterface $uri The URI to normalize * @param int $flags A bitmask of normalizations to apply, see constants * - * @see https://tools.ietf.org/html/rfc3986#section-6.2 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-6.2 */ public static function normalize(UriInterface $uri, int $flags = self::PRESERVING_NORMALIZATIONS): UriInterface { @@ -174,7 +174,7 @@ public static function normalize(UriInterface $uri, int $flags = self::PRESERVIN * @param UriInterface $uri2 An URI to compare * @param int $normalizations A bitmask of normalizations to apply, see constants * - * @see https://tools.ietf.org/html/rfc3986#section-6.1 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-6.1 */ public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, int $normalizations = self::PRESERVING_NORMALIZATIONS): bool { diff --git a/src/UriResolver.php b/src/UriResolver.php index 38d5793c..3737be1e 100644 --- a/src/UriResolver.php +++ b/src/UriResolver.php @@ -11,14 +11,14 @@ * * @author Tobias Schultze * - * @see https://tools.ietf.org/html/rfc3986#section-5 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5 */ final class UriResolver { /** * Removes dot segments from a path and returns the new path. * - * @see http://tools.ietf.org/html/rfc3986#section-5.2.4 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4 */ public static function removeDotSegments(string $path): string { @@ -53,7 +53,7 @@ public static function removeDotSegments(string $path): string /** * Converts the relative URI into a new URI that is resolved against the base URI. * - * @see http://tools.ietf.org/html/rfc3986#section-5.2 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2 */ public static function resolve(UriInterface $base, UriInterface $rel): UriInterface {