diff options
author | Andrey Andreev <narf@devilix.net> | 2017-10-16 10:05:58 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2017-10-16 10:05:58 +0200 |
commit | d282d07dfba94b5395d1dd989bdb958c972bb7cf (patch) | |
tree | cd50ef683b8d425057c0d50fc5cd1316d8474e85 /system/libraries/Form_validation.php | |
parent | fa2a0c58eb0f6421e3819df8a8873b5a5e4ebb58 (diff) |
[ci skip] Use INTL_IDNA_VARIANT_UCS46 to convert non-ASCII domain names in emails
Close #5300
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r-- | system/libraries/Form_validation.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 71d0e64b1..1619ec9a9 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1231,7 +1231,8 @@ class CI_Form_validation { { if (function_exists('idn_to_ascii') && preg_match('#\A([^@]+)@(.+)\z#', $str, $matches)) { - $str = $matches[1].'@'.idn_to_ascii($matches[2]); + $variant = defined('INTL_IDNA_VARIANT_UTS46') ? INTL_IDNA_VARIANT_UTS46 : INTL_IDNA_VARIANT_2003; + $str = $matches[1].'@'.idn_to_ascii($matches[2], $variant); } return (bool) filter_var($str, FILTER_VALIDATE_EMAIL); |