diff options
author | Andrey Andreev <narf@devilix.net> | 2017-11-09 19:38:33 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2017-11-09 19:38:33 +0100 |
commit | 4fd2d49461cd871a99a63c51563b8aee3d023abd (patch) | |
tree | 9741f7f48680d6c18d0aa4dc45ab076c9a144ec2 /system/libraries/Form_validation.php | |
parent | 37134fd545ba39804b3f9fb6f51547d422d1e261 (diff) |
More on #5003
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r-- | system/libraries/Form_validation.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index cd1d4a759..73fb2dab9 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1231,8 +1231,10 @@ class CI_Form_validation { { if (function_exists('idn_to_ascii') && preg_match('#\A([^@]+)@(.+)\z#', $str, $matches)) { - $variant = defined('INTL_IDNA_VARIANT_UTS46') ? INTL_IDNA_VARIANT_UTS46 : INTL_IDNA_VARIANT_2003; - $str = $matches[1].'@'.idn_to_ascii($matches[2], 0, $variant); + $domain = is_php('5.4') + ? idn_to_ascii($matches[2], 0, INTL_IDNA_VARIANT_UTS46) + : idn_to_ascii($matches[2]); + $str = $matches[1].'@'.$domain; } return (bool) filter_var($str, FILTER_VALIDATE_EMAIL); |