summaryrefslogtreecommitdiffstats
path: root/system/libraries/Email.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-03-20 17:30:02 +0100
committerFlorian Pritz <bluewind@xinu.at>2018-03-20 17:30:02 +0100
commit006cf0764295d37daa597f4ea9cf31abb75d1b68 (patch)
tree4f40341fef42c760330e2caa501881ab195a67b2 /system/libraries/Email.php
parent61e2a033717a4669117696d0b6913474e3f57954 (diff)
parent02a0518e1c56ba3506f370362ac5ebdb8a138312 (diff)
Merge tag 'ci-upstream/3.1.7' into dev
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'system/libraries/Email.php')
-rw-r--r--system/libraries/Email.php32
1 files changed, 18 insertions, 14 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 0e9cf0574..6a8bda70e 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2017, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2018, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -29,7 +29,7 @@
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
@@ -961,10 +961,8 @@ class CI_Email {
{
return 'plain-attach';
}
- else
- {
- return 'plain';
- }
+
+ return 'plain';
}
// --------------------------------------------------------------------
@@ -1034,9 +1032,13 @@ class CI_Email {
*/
public function valid_email($email)
{
- if (function_exists('idn_to_ascii') && $atpos = strpos($email, '@'))
+ if (function_exists('idn_to_ascii') && strpos($email, '@'))
{
- $email = self::substr($email, 0, ++$atpos).idn_to_ascii(self::substr($email, $atpos));
+ list($account, $domain) = explode('@', $email, 2);
+ $domain = is_php('5.4')
+ ? idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46)
+ : idn_to_ascii($domain);
+ $email = $account.'@'.$domain;
}
return (bool) filter_var($email, FILTER_VALIDATE_EMAIL);
@@ -1851,9 +1853,13 @@ class CI_Email {
*/
protected function _validate_email_for_shell(&$email)
{
- if (function_exists('idn_to_ascii') && $atpos = strpos($email, '@'))
+ if (function_exists('idn_to_ascii') && strpos($email, '@'))
{
- $email = self::substr($email, 0, ++$atpos).idn_to_ascii(self::substr($email, $atpos));
+ list($account, $domain) = explode('@', $email, 2);
+ $domain = is_php('5.4')
+ ? idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46)
+ : idn_to_ascii($domain);
+ $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));
@@ -2259,10 +2265,8 @@ class CI_Email {
usleep(250000);
continue;
}
- else
- {
- $timestamp = 0;
- }
+
+ $timestamp = 0;
}
if ($result === FALSE)