Skip to content

Commit

Permalink
Check for existence of Net_IDNA2
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel committed Jan 25, 2024
1 parent 57c806c commit cde8fdc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/Zend/Validate/Hostname.php
Original file line number Diff line number Diff line change
Expand Up @@ -2444,9 +2444,11 @@ protected function checkDnsRecords($hostName)
$toAscii = idn_to_ascii($hostName);
}
$result = checkdnsrr($toAscii, 'A');
} else {
} elseif (class_exists('Net_IDNA2')) {
$idn = new Net_IDNA2();
$result = checkdnsrr($idn->encode($hostName), 'A');
} else {
$result = checkdnsrr($hostName, 'A');
}

return $result;
Expand Down

0 comments on commit cde8fdc

Please sign in to comment.