summaryrefslogtreecommitdiffstats
path: root/system/libraries/Form_validation.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2017-06-19 11:02:53 +0200
committerAndrey Andreev <narf@devilix.net>2017-06-19 11:02:53 +0200
commit8186b6b398c26c0c1e0052eaddf4fc122e4929a5 (patch)
tree0290ebd53dd9b5167680e80e22342d751001fe56 /system/libraries/Form_validation.php
parentaf5c8960d80a9db362722ca675ffddb2079bbce9 (diff)
parent47f540e82cbc1591cc7f1aa92d47a8c8c4028c63 (diff)
Merge branch '3.1-stable' into develop
Conflicts resolved: system/core/CodeIgniter.php tests/codeigniter/libraries/Form_validation_test.php user_guide_src/source/changelog.rst user_guide_src/source/conf.py user_guide_src/source/installation/downloads.rst user_guide_src/source/installation/upgrading.rst
Diffstat (limited to 'system/libraries/Form_validation.php')
-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 7be0b949d..6eaf67710 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -1233,9 +1233,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);