Skip to content

Commit

Permalink
idn_to_ascii() fix for old PHP versions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyshockov committed Dec 23, 2019
1 parent 8781cac commit 72341dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/functions.php
Expand Up @@ -359,7 +359,9 @@ function _idn_uri_convert(UriInterface $uri, $options = 0)
{
if ($uri->getHost()) {
$idnaVariant = defined('INTL_IDNA_VARIANT_UTS46') ? INTL_IDNA_VARIANT_UTS46 : 0;
$asciiHost = idn_to_ascii($uri->getHost(), $options, $idnaVariant, $info);
$asciiHost = $idnaVariant === 0
? idn_to_ascii($uri->getHost(), $options)
: idn_to_ascii($uri->getHost(), $options, $idnaVariant, $info);
if ($asciiHost === false) {
$errorBitSet = isset($info['errors']) ? $info['errors'] : 0;

Expand Down

0 comments on commit 72341dc

Please sign in to comment.