From 8a7078b65dc387c8d74f963b80a7559bd094458a Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 17 Oct 2012 10:52:49 +0300 Subject: Fix issue #1897 --- system/libraries/Email.php | 16 ++++++---------- user_guide_src/source/changelog.rst | 1 + 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 08057f2f7..5b17edf9b 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -292,16 +292,7 @@ class CI_Email { $this->set_header('To', implode(', ', $to)); } - switch ($this->_get_protocol()) - { - case 'smtp': - $this->_recipients = $to; - break; - case 'sendmail': - case 'mail': - $this->_recipients = implode(', ', $to); - break; - } + $this->_recipients = $to; return $this; } @@ -1408,6 +1399,11 @@ class CI_Email { */ protected function _send_with_mail() { + if (is_array($this->_recipients)) + { + $this->_recipients = implode(', ', $this->_recipients); + } + if ($this->_safe_mode === TRUE) { return mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str); diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 811aa8faf..cbd7c83f5 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -363,6 +363,7 @@ Bug fixes for 3.0 - Fixed a bug (#1709) - :doc:`Email ` headers were broken when using long email subjects and \r\n as CRLF. - Fixed a bug where ``MB_ENABLED`` was only declared if ``UTF8_ENABLED`` was set to TRUE. - Fixed a bug where the :doc:`Session Library ` accepted cookies with *last_activity* values being in the future. +- Fixed a bug (#1897) - :doc:`Email Library ` triggered PHP E_WARNING errors when *mail* protocol used and ``to()`` is never called. Version 2.1.3 ============= -- cgit v1.2.3-24-g4f1b