Skip to content

Commit

Permalink
Merge branch '7.1' into 7.2
Browse files Browse the repository at this point in the history
* 7.1:
  fix merge
  fix merge
  Bump Symfony version to 7.1.9
  Work around parse_url() bug (bis)
  Update VERSION for 7.1.8
  Update CHANGELOG for 7.1.8
  Bump Symfony version to 6.4.16
  fix PHP 7.2 compatibility
  silence PHP warnings issued by Redis::connect()
  Update VERSION for 6.4.15
  Update CHANGELOG for 6.4.15
  Bump Symfony version to 5.4.48
  Update VERSION for 5.4.47
  Update CHANGELOG for 5.4.47
  [Routing] Fix: lost priority when defining hosts in configuration
  fix dumping tests to skip with data providers
  • Loading branch information
nicolas-grekas committed Nov 13, 2024
2 parents 3e838f9 + fd00664 commit b176e1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Tests/UriResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public static function provideResolverTests()

['http://', 'http://localhost', 'http://'],
['/foo:123', 'http://localhost', 'http://localhost/foo:123'],
['foo:123', 'http://localhost/', 'foo:123'],
['foo/bar:1/baz', 'http://localhost/', 'http://localhost/foo/bar:1/baz'],
];
}
}
6 changes: 1 addition & 5 deletions UriResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ public static function resolve(string $uri, ?string $baseUri): string
{
$uri = trim($uri);

if (false === ($scheme = parse_url($uri, \PHP_URL_SCHEME)) && '/' === ($uri[0] ?? '')) {
$scheme = parse_url($uri.'#', \PHP_URL_SCHEME);
}

// absolute URL?
if (null !== $scheme) {
if (null !== parse_url(\strlen($uri) !== strcspn($uri, '?#') ? $uri : $uri.'#', \PHP_URL_SCHEME)) {
return $uri;
}

Expand Down

0 comments on commit b176e1f

Please sign in to comment.