diff options
author | Andrey Andreev <narf@devilix.net> | 2018-06-12 15:25:44 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2018-06-12 15:35:09 +0200 |
commit | 32f8c936898a3619f225f614d03b1cdf7a7e2750 (patch) | |
tree | 7d16bf24a9ebc1c77fed00ad83553d1f946fc704 /system/libraries/Email.php | |
parent | 6ec8737d96312be99f1e3b6dffaab584cc6204d4 (diff) |
Merge pull request #5510 from johndekroon/develop
Only use the output of idn_to_ascii() if it worked properly
Diffstat (limited to 'system/libraries/Email.php')
-rw-r--r-- | system/libraries/Email.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php index a53e7e72a..cd74d6da1 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1038,7 +1038,11 @@ class CI_Email { $domain = defined('INTL_IDNA_VARIANT_UTS46') ? idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46) : idn_to_ascii($domain); - $email = $account.'@'.$domain; + + if ($domain !== FALSE) + { + $email = $account.'@'.$domain; + } } return (bool) filter_var($email, FILTER_VALIDATE_EMAIL); @@ -1859,7 +1863,11 @@ class CI_Email { $domain = defined('INTL_IDNA_VARIANT_UTS46') ? idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46) : idn_to_ascii($domain); - $email = $account.'@'.$domain; + + if ($domain !== FALSE) + { + $email = $account.'@'.$domain; + } } return (filter_var($email, FILTER_VALIDATE_EMAIL) === $email && preg_match('#\A[a-z0-9._+-]+@[a-z0-9.-]{1,253}\z#i', $email)); |