summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2017-06-19 07:25:23 +0200
committerAndrey Andreev <narf@devilix.net>2017-06-19 07:25:23 +0200
commited1a0453a9372e88058169f2028c9a2140318961 (patch)
treeadeec34eca761c8504c4d5231bf64d08ab01465d /system
parentda6ac585e32ffb036ec3cb6b0475407901146e4a (diff)
[ci skip] Fix a bug in FV valid_email()
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Form_validation.php4
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);