diff --git a/src/Url.php b/src/Url.php index 94e9f21..8b0ae38 100644 --- a/src/Url.php +++ b/src/Url.php @@ -19,7 +19,11 @@ public function __construct(string $url) } if (strlen($url) < 61 && function_exists('idn_to_ascii')) { - $url = idn_to_ascii($url, false, INTL_IDNA_VARIANT_UTS46); + if (defined('INTL_IDNA_VARIANT_UTS46')) { + $url = idn_to_ascii($url, false, INTL_IDNA_VARIANT_UTS46); + } else { + $url = idn_to_ascii($url); + } } if (! filter_var($url, FILTER_VALIDATE_URL)) {