Skip to content

Commit 9d307ec

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: [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 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
2 parents 105b56a + 4c76e41 commit 9d307ec

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Tests/UriResolverTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public static function provideResolverTests()
8686
['foo', 'http://localhost#bar', 'http://localhost/foo'],
8787

8888
['http://', 'http://localhost', 'http://'],
89+
['/foo:123', 'http://localhost', 'http://localhost/foo:123'],
8990
];
9091
}
9192
}

UriResolver.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ public static function resolve(string $uri, ?string $baseUri): string
3232
{
3333
$uri = trim($uri);
3434

35+
if (false === ($scheme = parse_url($uri, \PHP_URL_SCHEME)) && '/' === ($uri[0] ?? '')) {
36+
$scheme = parse_url($uri.'#', \PHP_URL_SCHEME);
37+
}
38+
3539
// absolute URL?
36-
if (null !== parse_url($uri, \PHP_URL_SCHEME)) {
40+
if (null !== $scheme) {
3741
return $uri;
3842
}
3943

0 commit comments

Comments
 (0)