Skip to content

Commit 0cfd892

Browse files
Support uppercase IPv6 addresses in URI (#620)
RFC8187 implies that the HEXDIG values that compose an IP-Literal substring (IPv6 is a special case of IP-Literal) can contain both lowercase and uppercase characters for the non-numeric part. As a consequence, all characters in [0-9a-fA-f] are valid in an IPv6 literal address as found in the URI. References: * https://datatracker.ietf.org/doc/html/rfc5234 * https://datatracker.ietf.org/doc/html/rfc8187 Signed-off-by: Emmanuel Deloget <[email protected]>
1 parent a2474ad commit 0cfd892

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Uri.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private static function parse(string $url)
107107
{
108108
// If IPv6
109109
$prefix = '';
110-
if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) {
110+
if (preg_match('%^(.*://\[[0-9:a-fA-F]+\])(.*?)$%', $url, $matches)) {
111111
/** @var array{0:string, 1:string, 2:string} $matches */
112112
$prefix = $matches[1];
113113
$url = $matches[2];

0 commit comments

Comments
 (0)