}
// PHP 5.3 and later support this functionality natively
- if (function_exists('idn_to_ascii')) {
+ // WoltLab modification: the IDNA-constant is not available with the IDN-extension
+ // see https://github.com/ezyang/htmlpurifier/issues/168
+ if (function_exists('idn_to_ascii') && defined('IDNA_NONTRANSITIONAL_TO_ASCII') && defined('INTL_IDNA_VARIANT_UTS46')) {
// WoltLab modification: backport of a change in a to-be-released version for PHP 7.2 compatibility
// see https://github.com/ezyang/htmlpurifier/commit/ce0ede24ded2e05489f5bab50cc53426599532e4
$string = idn_to_ascii($string, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);