diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-10-09 14:00:00 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-10-09 14:00:00 +0200 |
commit | 683b34d6dfcc10bee7703af605875df9229c2bea (patch) | |
tree | ebef117f49650552204aecd7dbc417cc9bcfb427 | |
parent | 9df35b4d23848e831ead765712addd0b845fd8f4 (diff) |
Alter CI_Emai::_prep_quoted_printable()
-rw-r--r-- | system/libraries/Email.php | 13 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 36bdd1f22..36ecc347d 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -980,7 +980,6 @@ class CI_Email { $this->_finalbody = $body.$this->_prep_quoted_printable($this->_body).$this->newline.$this->newline; - if ($this->_get_protocol() === 'mail') { $this->_header_str .= $hdr; @@ -1100,11 +1099,19 @@ class CI_Email { * Refer to RFC 2045 http://www.ietf.org/rfc/rfc2045.txt * * @param string - * @param int * @return string */ - protected function _prep_quoted_printable($str, $charlim = '') + protected function _prep_quoted_printable($str) { + // RFC 2045 specifies CRLF as "\r\n". + // However, many developers choose to override that and violate + // the RFC rules due to (apparently) a bug in MS Exchange, + // which only works with "\n". + if ($this->crlf === "\r\n" && is_php('5.3')) + { + return quoted_printable_encode($str); + } + // Set the character limit // Don't allow over 76, as that will make servers and MUAs barf // all over quoted-printable data diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index a90336a1d..ba2036dd8 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -198,6 +198,8 @@ Release Date: Not Released - Renamed method _set_header() to set_header() and made it public to enable adding custom headers in the :doc:`Email Library <libraries/email>`. - Successfully sent emails will automatically clear the parameters. - Added a *return_path* parameter to the ``from()`` method. + - Removed the second parameter (character limit) from internal method ``_prep_quoted_printable()`` as it is never used. + - Internal method ``_prep_quoted_printable()`` will now utilize the native ``quoted_printable_encode()`` function on PHP 5.3+ if CRLF is set to "\r\n". - :doc:`Pagination Library <libraries/pagination>` changes include: - Added support for the anchor "rel" attribute. - Added support for setting custom attributes. |