Skip to content

Commit 3f55da6

Browse files
committed
Merge branch '4.4' into 5.3
* 4.4: added missing translations for portuguese [#43726] [HttpClient][Mime] Add correct IDN flags for IDNA2008 compliance properly parse quoted strings tagged with !!str do not merge label classes into expanded choice labels [Serializer] PropertyNormalizer - return unique (i.e. filter duplicate ) attributes in extractAttributes function
2 parents 7c5c562 + b80aac7 commit 3f55da6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

HttpClientTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ private static function parseUrl(string $url, array $query = [], array $allowedS
485485
throw new InvalidArgumentException(sprintf('Unsupported IDN "%s", try enabling the "intl" PHP extension or running "composer require symfony/polyfill-intl-idn".', $host));
486486
}
487487

488-
$host = \defined('INTL_IDNA_VARIANT_UTS46') ? idn_to_ascii($host, \IDNA_DEFAULT, \INTL_IDNA_VARIANT_UTS46) ?: strtolower($host) : strtolower($host);
488+
$host = \defined('INTL_IDNA_VARIANT_UTS46') ? idn_to_ascii($host, \IDNA_DEFAULT | \IDNA_USE_STD3_RULES | \IDNA_CHECK_BIDI | \IDNA_CHECK_CONTEXTJ | \IDNA_NONTRANSITIONAL_TO_ASCII, \INTL_IDNA_VARIANT_UTS46) ?: strtolower($host) : strtolower($host);
489489
$host .= $port ? ':'.$port : '';
490490
}
491491

Tests/HttpClientTraitTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ public function provideParseUrl(): iterable
163163
yield [[null, null, 'bar', '?a%5Bb%5Bc%5D=d', null], 'bar?a[b[c]=d', []];
164164
yield [[null, null, 'bar', '?a%5Bb%5D%5Bc%5D=dd', null], 'bar?a[b][c]=d&e[f]=g', ['a' => ['b' => ['c' => 'dd']], 'e[f]' => null]];
165165
yield [[null, null, 'bar', '?a=b&a%5Bb%20c%5D=d&e%3Df=%E2%9C%93', null], 'bar?a=b', ['a' => ['b c' => 'd'], 'e=f' => '']];
166+
// IDNA 2008 compliance
167+
yield [['https:', '//xn--fuball-cta.test', null, null, null], 'https://fußball.test'];
166168
}
167169

168170
/**

0 commit comments

Comments
 (0)