Skip to content

Commit

Permalink
Merge branch '6.4' into 7.1
Browse files Browse the repository at this point in the history
* 6.4:
  fix merge
  [Intl] Update ICU data from 74.1 to 75.1
  use DeprecatedCallableInfo for Twig callables if possible
  [Filesystem] Add a warning about `chown()` and `chgrp()` on Windows
  [String] Update wcswidth data with Unicode 16
  PhpSubprocess: Add flag PREG_OFFSET_CAPTURE to preg_match to identify the offset
  Work around parse_url() bug
  [Ldap] Clean `ldap_connect()` call in `LdapTestCase`
  [HttpFoundation] Update links for X-Accel-Redirect and fail properly when X-Accel-Mapping is missing
  • Loading branch information
xabbuh committed Sep 15, 2024
2 parents 01ce817 + 9d307ec commit b92af23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Tests/UriResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public static function provideResolverTests()
['foo', 'http://localhost#bar', 'http://localhost/foo'],

['http://', 'http://localhost', 'http://'],
['/foo:123', 'http://localhost', 'http://localhost/foo:123'],
];
}
}
6 changes: 5 additions & 1 deletion UriResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ 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 !== parse_url($uri, \PHP_URL_SCHEME)) {
if (null !== $scheme) {
return $uri;
}

Expand Down

0 comments on commit b92af23

Please sign in to comment.