Skip to content

Commit

Permalink
Check for missing 'INTL_IDNA_VARIANT_UTS46' to constant (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
markokeeffe authored and freekmurze committed Jul 22, 2019
1 parent 0816ee9 commit 5e45f29
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 5e45f29

Please sign in to comment.