summaryrefslogtreecommitdiffstats
path: root/system/libraries/Form_validation.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/Form_validation.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/Form_validation.php')
-rw-r--r--system/libraries/Form_validation.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 106907289..bea51648e 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -1240,7 +1240,11 @@ class CI_Form_validation {
$domain = defined('INTL_IDNA_VARIANT_UTS46')
? idn_to_ascii($matches[2], 0, INTL_IDNA_VARIANT_UTS46)
: idn_to_ascii($matches[2]);
- $str = $matches[1].'@'.$domain;
+
+ if ($domain !== FALSE)
+ {
+ $str = $matches[1].'@'.$domain;
+ }
}
return (bool) filter_var($str, FILTER_VALIDATE_EMAIL);