Manual backport of a future HTMLPurifier change for PHP 7.2
authorAlexander Ebert <ebert@woltlab.com>
Tue, 2 Jan 2018 14:29:55 +0000 (15:29 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 2 Jan 2018 14:29:55 +0000 (15:29 +0100)
wcfsetup/install/files/lib/system/api/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php

index 3b4d186743e22111c0ff609c29a29b941fb75b45..a0d44006c104a7e39f3b20dd7224951195b9fda5 100644 (file)
@@ -97,7 +97,9 @@ class HTMLPurifier_AttrDef_URI_Host extends HTMLPurifier_AttrDef
 
         // PHP 5.3 and later support this functionality natively
         if (function_exists('idn_to_ascii')) {
-            $string = idn_to_ascii($string);
+               // 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);
 
         // If we have Net_IDNA2 support, we can support IRIs by
         // punycoding them. (This is the most portable thing to do,