diff --git a/src/functions.php b/src/functions.php index 1924d6d33..5e806f632 100644 --- a/src/functions.php +++ b/src/functions.php @@ -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;