diff options
author | Andrey Andreev <narf@devilix.net> | 2015-08-31 14:23:42 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-08-31 14:23:42 +0200 |
commit | 8e138eced12fa88da721cc9b840fe4aa02c9e031 (patch) | |
tree | 53b8cfabe7e4b801690d13b2f26fa33eebfa59d0 | |
parent | 24a4a6ac476b0ca1d47d01fdb8f2b3a6e7b39c24 (diff) |
Fix #4073
-rw-r--r-- | system/libraries/Email.php | 23 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 1 |
2 files changed, 17 insertions, 7 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 459c8f590..acf3629c3 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1869,20 +1869,26 @@ class CI_Email { return FALSE; } - $this->_send_command('from', $this->clean_email($this->_headers['From'])); + if ( ! $this->_send_command('from', $this->clean_email($this->_headers['From']))) + { + return FALSE; + } foreach ($this->_recipients as $val) { - $this->_send_command('to', $val); + if ( ! $this->_send_command('to', $val)) + { + return FALSE; + } } if (count($this->_cc_array) > 0) { foreach ($this->_cc_array as $val) { - if ($val !== '') + if ($val !== '' && ! $this->_send_command('to', $val)) { - $this->_send_command('to', $val); + return FALSE; } } } @@ -1891,14 +1897,17 @@ class CI_Email { { foreach ($this->_bcc_array as $val) { - if ($val !== '') + if ($val !== '' && ! $this->_send_command('to', $val)) { - $this->_send_command('to', $val); + return FALSE; } } } - $this->_send_command('data'); + if ( ! $this->_send_command('data')) + { + return FALSE; + } // perform dot transformation on any lines that begin with a dot $this->_send_data($this->_header_str.preg_replace('/^\./m', '..$1', $this->_finalbody)); diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 7c671c0b7..bdde1ca97 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -21,6 +21,7 @@ Bug fixes for 3.0.2 - Fixed a bug where the :doc:`Database Class <database/index>` entered an endless loop if it fails to connect with the 'sqlsrv' driver. - Fixed a bug (#4065) - :doc:`Database <database/index>` method ``protect_identifiers()`` treats a traling space as an alias separator if the input doesn't contain ' AS '. - Fixed a bug (#4066) - :doc:`Cache Library <libraries/caching>` couldn't fallback to a backup driver if the primary one is Memcache(d) or Redis. +- Fixed a bug (#4073) - :doc:`Email Library <libraries/email>` method ``send()`` could return TRUE in case of an actual failure when an SMTP command fails. Version 3.0.1 ============= |