From 683b34d6dfcc10bee7703af605875df9229c2bea Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 9 Oct 2012 15:00:00 +0300 Subject: Alter CI_Emai::_prep_quoted_printable() --- system/libraries/Email.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'system') 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 -- cgit v1.2.3-24-g4f1b