Skip to content

Commit

Permalink
Fix URI RFC3986 parsing and invalid characters
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Dec 29, 2024
1 parent fac5c63 commit afe442f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions interfaces/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ All Notable changes to `League\Uri\Interfaces` will be documented in this file
- `League\Uri\IPv6\Converter::isIpv6`
- `UriString::resolve`
- `UriString::removeDotSegments`
- `UriString::parseAndNormalize`
- `UriString::parseAuthorityAndNormalize`
- `UriString::normalize`
- `UriString::normalizeAuthority`

### Fixed

Expand Down
4 changes: 1 addition & 3 deletions interfaces/UriString.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use League\Uri\Exceptions\ConversionFailed;
use League\Uri\Exceptions\MissingFeature;
use League\Uri\Exceptions\SyntaxError;
use League\Uri\Idna\Converter;
use League\Uri\Idna\Converter as IdnaConverter;
use League\Uri\IPv6\Converter as IPv6Converter;
use Stringable;
Expand Down Expand Up @@ -486,7 +485,6 @@ private static function resolvePathAndQuery(array $uri, array $baseUri): array
public static function parse(Stringable|string|int $uri): array
{
$uri = (string) $uri;

if (isset(self::URI_SHORTCUTS[$uri])) {
/** @var ComponentMap $components */
$components = [...self::URI_COMPONENTS, ...self::URI_SHORTCUTS[$uri]];
Expand Down Expand Up @@ -660,7 +658,7 @@ private static function filterRegisteredName(string $host): void
throw new SyntaxError(sprintf('Host `%s` is invalid: the host is not a valid registered name', $host));
}

Converter::toAsciiOrFail($host);
IdnaConverter::toAsciiOrFail($host);
}

/**
Expand Down

0 comments on commit afe442f

Please sign in to comment.