Skip to content

Commit 23dcaa3

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 4c92046 + f09ba83 commit 23dcaa3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

HttpClientTrait.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,10 @@ private static function resolveUrl(array $url, ?array $base, array $queryDefault
627627
private static function parseUrl(string $url, array $query = [], array $allowedSchemes = ['http' => 80, 'https' => 443]): array
628628
{
629629
if (false === $parts = parse_url($url)) {
630-
throw new InvalidArgumentException(sprintf('Malformed URL "%s".', $url));
630+
if ('/' !== ($url[0] ?? '') || false === $parts = parse_url($url.'#')) {
631+
throw new InvalidArgumentException(sprintf('Malformed URL "%s".', $url));
632+
}
633+
unset($parts['fragment']);
631634
}
632635

633636
if ($query) {

NativeHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ private static function createRedirectResolver(array $options, string $host, str
414414

415415
[$host, $port] = self::parseHostPort($url, $info);
416416

417-
if (false !== (parse_url($location, \PHP_URL_HOST) ?? false)) {
417+
if (false !== (parse_url($location.'#', \PHP_URL_HOST) ?? false)) {
418418
// Authorization and Cookie headers MUST NOT follow except for the initial host name
419419
$requestHeaders = $redirectHeaders['host'] === $host && $redirectHeaders['port'] === $port ? $redirectHeaders['with_auth'] : $redirectHeaders['no_auth'];
420420
$requestHeaders[] = 'Host: '.$host.$port;

0 commit comments

Comments
 (0)