diff options
author | Andrey Andreev <narf@devilix.net> | 2017-06-19 07:25:23 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2017-06-19 07:25:23 +0200 |
commit | ed1a0453a9372e88058169f2028c9a2140318961 (patch) | |
tree | adeec34eca761c8504c4d5231bf64d08ab01465d /system/libraries/Form_validation.php | |
parent | da6ac585e32ffb036ec3cb6b0475407901146e4a (diff) |
[ci skip] Fix a bug in FV valid_email()
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r-- | system/libraries/Form_validation.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 4f679a17f..71d0e64b1 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1229,9 +1229,9 @@ class CI_Form_validation { */ public function valid_email($str) { - if (function_exists('idn_to_ascii') && sscanf($str, '%[^@]@%s', $name, $domain) === 2) + if (function_exists('idn_to_ascii') && preg_match('#\A([^@]+)@(.+)\z#', $str, $matches)) { - $str = $name.'@'.idn_to_ascii($domain); + $str = $matches[1].'@'.idn_to_ascii($matches[2]); } return (bool) filter_var($str, FILTER_VALIDATE_EMAIL); |