diff options
author | Andrey Andreev <narf@devilix.net> | 2018-01-22 13:29:50 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2018-01-22 13:29:50 +0100 |
commit | 6545f8595480ab64220aacc8a5176383dac4122b (patch) | |
tree | 31e9f0a592801fe07dba5d99a3b73526d10b101f /system/libraries/Form_validation.php | |
parent | 3738910fce3192054cd2815d814ab261c3d3868c (diff) | |
parent | 329dd039a211ed7634b45e2c908f7dc375b806a2 (diff) |
Merge branch '3.1-stable' into develop
Conflicts resolved:
system/libraries/Email.php
system/libraries/Form_validation.php
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r-- | system/libraries/Form_validation.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index f402459a9..9e4c81c61 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1237,7 +1237,10 @@ class CI_Form_validation { { if (function_exists('idn_to_ascii') && preg_match('#\A([^@]+)@(.+)\z#', $str, $matches)) { - $str = $matches[1].'@'.idn_to_ascii($matches[2], 0, INTL_IDNA_VARIANT_UTS46); + $domain = defined('INTL_IDNA_VARIANT_UTS46') + ? 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); |