Skip to content

Commit 9a50e91

Browse files
committed
Update changelog for URI interface package
1 parent 542360c commit 9a50e91

File tree

4 files changed

+36
-8
lines changed

4 files changed

+36
-8
lines changed

interfaces/CHANGELOG.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,39 @@ All Notable changes to `League\Uri\Interfaces` will be documented in this file
88

99
- `Contidionable` interface
1010
- `UriInspector` interface
11-
- `UriEncoder` interface
11+
- `UriRenderer` interface
1212
- `UriInterface::resolve`
1313
- `UriInterface::relativize`
1414
- `UriInterface::equals`
1515
- `UriInterface::toNormalizedString`
1616
- `UriInterface::getUser`
1717
- `League\Uri\IPv6\Converter::isIpv6`
18+
- `League\Uri\IPv6\Converter::normalize`
1819
- `UriString::resolve`
1920
- `UriString::removeDotSegments`
2021
- `UriString::normalize`
2122
- `UriString::normalizeAuthority`
23+
- `UriString::containsValidRfc3986Characters`
24+
- `UriString::containsValidRfc3987Characters`
25+
- `UriString::isValidScheme`
26+
- `UriString::isValidHost`
2227
- `FeatureDetection::supportsDom`
2328
- `Encoder::decodeNecessary`
2429
- `Encoder::decodePath`
2530
- `Encoder::decodeQuery`
2631
- `Encoder::decodeFragment`
32+
- `Encoder::isUserEncoded`
33+
- `Encoder::isPasswordEncoded`
34+
- `Encoder::isUserInfoEncoded`
35+
- `Encoder::isPathEncoded`
36+
- `Encoder::isQueryEncoded`
37+
- `Encoder::isFragmentEncoded`
38+
- `Encoder::normalizeUser`
39+
- `Encoder::normalizePassword`
40+
- `Encoder::normalizePath`
41+
- `Encoder::normalizeQuery`
42+
- `Encoder::normalizeFragment`
43+
- `Encoder::normalizeHost`
2744

2845
### Fixed
2946

interfaces/Encoder.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,21 @@ public static function normalizePassword(#[SensitiveParameter] Stringable|string
128128
return self::encodePassword(self::decodeUnreservedCharacters($password));
129129
}
130130

131+
/**
132+
* Tell whether the userInfo component is correctly encoded.
133+
*/
134+
public static function isUserInfoEncoded(#[SensitiveParameter] Stringable|string|null $userInfo): bool
135+
{
136+
if (null === $userInfo) {
137+
return true;
138+
}
139+
140+
[$user, $password] = explode(':', (string) $userInfo, 2) + [1 => null];
141+
142+
return self::isUserEncoded($user)
143+
&& self::isPasswordEncoded($password);
144+
}
145+
131146
/**
132147
* Decodes all the URI component characters.
133148
*/

interfaces/UriString.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -739,20 +739,16 @@ private static function filterHost(Stringable|string|null $host): ?string
739739

740740
/**
741741
* Tells whether the scheme component is valid.
742-
*
743-
*
744742
*/
745-
public static function isScheme(Stringable|string|null $scheme): bool
743+
public static function isValidScheme(Stringable|string|null $scheme): bool
746744
{
747745
return null === $scheme || 1 === preg_match('/^[A-Za-z]([-A-Za-z\d+.]+)?$/', (string) $scheme);
748746
}
749747

750748
/**
751749
* Tells whether the host component is valid.
752-
*
753-
*
754750
*/
755-
public static function isHost(Stringable|string|null $host): bool
751+
public static function isValidHost(Stringable|string|null $host): bool
756752
{
757753
try {
758754
self::filterHost($host);

uri/Uri.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ private function formatScheme(?string $scheme): ?string
320320

321321
if (
322322
!array_key_exists($formattedScheme, self::SCHEME_DEFAULT_PORT)
323-
&& !UriString::isScheme($formattedScheme)
323+
&& !UriString::isValidScheme($formattedScheme)
324324
) {
325325
throw new SyntaxError('The scheme `'.$scheme.'` is invalid.');
326326
}

0 commit comments

Comments
 (0)