summaryrefslogtreecommitdiffstats
path: root/system/libraries/Email.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2018-06-12 15:25:44 +0200
committerGitHub <noreply@github.com>2018-06-12 15:25:44 +0200
commit9dfb18ce15e50521a1482f6610a2aeaa221b256c (patch)
tree85e66f27e44a710d9d71130dec15f1b9e310935b /system/libraries/Email.php
parentdc4a791ab07eeadb6f67eb26311c07199855390f (diff)
parent9bf6753a1bcd54d6ca69fc194efc9f982661aa66 (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.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 55f81f4bd..d9da06057 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -1017,7 +1017,11 @@ class CI_Email {
$domain = defined('INTL_IDNA_VARIANT_UTS46')
? idn_to_ascii($matches[2], 0, INTL_IDNA_VARIANT_UTS46)
: idn_to_ascii($matches[2]);
- $email = $matches[1].'@'.$domain;
+
+ if ($domain !== FALSE)
+ {
+ $email = $account.'@'.$domain;
+ }
}
return (bool) filter_var($email, FILTER_VALIDATE_EMAIL);
@@ -1828,7 +1832,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));