diff options
author | Andrey Andreev <narf@devilix.net> | 2013-08-07 13:32:56 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2013-08-07 13:32:56 +0200 |
commit | 2b956af4588eb64a7a4f9c72e1d223a33b65e8c6 (patch) | |
tree | fa33a2f4bb92494d468f139c1df1d84c3a948cc0 | |
parent | 5a215b6064c9ce7ee33db9a76bcb1a62bea16ec3 (diff) |
An improved version of PR #2584, fixes #2583
-rw-r--r-- | system/libraries/Email.php | 24 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 1 |
2 files changed, 14 insertions, 11 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 46ffaa1d4..082629a4c 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1265,7 +1265,7 @@ class CI_Email { } else { - $this->_finalbody = $hdr . $this->newline . $this->newline . $this->_body; + $this->_finalbody = $hdr.$this->newline.$this->newline.$this->_body; } return; @@ -1275,11 +1275,11 @@ class CI_Email { if ($this->send_multipart === FALSE) { $hdr .= 'Content-Type: text/html; charset='.$this->charset.$this->newline - .'Content-Transfer-Encoding: quoted-printable'.$this->newline.$this->newline; + .'Content-Transfer-Encoding: quoted-printable'; } else { - $hdr .= 'Content-Type: multipart/alternative; boundary="'.$this->_alt_boundary.'"'.$this->newline.$this->newline; + $hdr .= 'Content-Type: multipart/alternative; boundary="'.$this->_alt_boundary.'"'; $body .= $this->_get_mime_message().$this->newline.$this->newline .'--'.$this->_alt_boundary.$this->newline @@ -1300,7 +1300,7 @@ class CI_Email { } else { - $this->_finalbody = $hdr.$this->_finalbody; + $this->_finalbody = $hdr.$this->newline.$this->newline.$this->_finalbody; } if ($this->send_multipart !== FALSE) @@ -1312,25 +1312,25 @@ class CI_Email { case 'plain-attach' : - $hdr .= 'Content-Type: multipart/'.$this->multipart.'; boundary="'.$this->_atc_boundary.'"'.$this->newline.$this->newline; + $hdr .= 'Content-Type: multipart/'.$this->multipart.'; boundary="'.$this->_atc_boundary.'"'; if ($this->_get_protocol() === 'mail') { $this->_header_str .= $hdr; } - $body .= $this->_get_mime_message().$this->newline.$this->newline + $body .= $this->_get_mime_message().$this->newline + .$this->newline .'--'.$this->_atc_boundary.$this->newline - .'Content-Type: text/plain; charset='.$this->charset.$this->newline - .'Content-Transfer-Encoding: '.$this->_get_encoding().$this->newline.$this->newline - + .'Content-Transfer-Encoding: '.$this->_get_encoding().$this->newline + .$this->newline .$this->_body.$this->newline.$this->newline; break; case 'html-attach' : - $hdr .= 'Content-Type: multipart/'.$this->multipart.'; boundary="'.$this->_atc_boundary.'"'.$this->newline.$this->newline; + $hdr .= 'Content-Type: multipart/'.$this->multipart.'; boundary="'.$this->_atc_boundary.'"'; if ($this->_get_protocol() === 'mail') { @@ -1400,7 +1400,9 @@ class CI_Email { } $body .= implode($this->newline, $attachment).$this->newline.'--'.$this->_atc_boundary.'--'; - $this->_finalbody = ($this->_get_protocol() === 'mail') ? $body : $hdr.$body; + $this->_finalbody = ($this->_get_protocol() === 'mail') + ? $body + : $hdr.$this->newline.$this->newline.$body; return TRUE; } diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index a987c507d..8b73e7a98 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -605,6 +605,7 @@ Bug fixes for 3.0 - Fixed a bug (#2551) - :doc:`Loader Library <libraries/loader>` method ``library()`` didn't properly check if a class that is being loaded already exists. - Fixed a bug (#2560) - :doc:`Form Helper <helpers/form_helper>` function :php:func:`form_open()` set the 'method="post"' attribute only if the passed attributes equaled an empty string. - Fixed a bug (#2585) - :doc:`Query Builder <database/query_builder>` methods ``min()``, ``max()``, ``avg()``, ``sum()`` didn't escape field names. +- Fixed an edge case (#2583) in the :doc:`Email Library <libraries/email>` where `Suhosin <http://www.hardened-php.net/suhosin/>` blocked messages sent via ``mail()`` due to trailing newspaces in headers. Version 2.1.4 ============= |