Permalink
Browse files

Alter CI_Emai::_prep_quoted_printable()

  • Loading branch information...
1 parent 9df35b4 commit 683b34d6dfcc10bee7703af605875df9229c2bea @narfbg narfbg committed Oct 9, 2012
Showing with 12 additions and 3 deletions.
  1. +10 −3 system/libraries/Email.php
  2. +2 −0 user_guide_src/source/changelog.rst
@@ -980,7 +980,6 @@ protected function _build_message()
$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 @@ protected function _build_message()
* 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
@@ -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.

0 comments on commit 683b34d

Please sign in to comment.