Skip to content

Commit

Permalink
Merge branch '4.4' into 5.3
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
derrabus committed Nov 20, 2021
2 parents 7c5c562 + b80aac7 commit 3f55da6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion HttpClientTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ private static function parseUrl(string $url, array $query = [], array $allowedS
throw new InvalidArgumentException(sprintf('Unsupported IDN "%s", try enabling the "intl" PHP extension or running "composer require symfony/polyfill-intl-idn".', $host));
}

$host = \defined('INTL_IDNA_VARIANT_UTS46') ? idn_to_ascii($host, \IDNA_DEFAULT, \INTL_IDNA_VARIANT_UTS46) ?: strtolower($host) : strtolower($host);
$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);
$host .= $port ? ':'.$port : '';
}

Expand Down
2 changes: 2 additions & 0 deletions Tests/HttpClientTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ public function provideParseUrl(): iterable
yield [[null, null, 'bar', '?a%5Bb%5Bc%5D=d', null], 'bar?a[b[c]=d', []];
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]];
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' => '']];
// IDNA 2008 compliance
yield [['https:', '//xn--fuball-cta.test', null, null, null], 'https://fußball.test'];
}

/**
Expand Down

0 comments on commit 3f55da6

Please sign in to comment.