Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.12

Bug #21098 Discrepancy in handling of empty (but set) plain text part
Submitted: 2016-07-14 17:50 UTC
From: alec Assigned: alec
Status: Closed Package: Mail_Mime (version 1.10.0)
PHP Version: Irrelevant OS:
Roadmaps: 1.10.1    
Subscription  


 [2016-07-14 17:50 UTC] alec (Aleksander Machniak)
Description: ------------ There's inconsistency in detecting existence of a plain text part in generating a message and headers. Once we use strlen($this->txtbody) > 0, and once we use isset($this->txtbody). This causes issues with Content-Type header which for the same message can return text/html for the first time, but multipart/alternative after get() method was called. Test script: --------------- $mime = new Mail_mime(); $mime->setTxtBody(''); $mime->setHTMLBody('<html></html>'); $headers1 = $mime->txtHeaders(); $body = $mime->get(); $headers2 = $mime->txtHeaders(); print $headers1 . $headers2; Expected result: ---------------- MIME-Version: 1.0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Actual result: -------------- MIME-Version: 1.0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_d20b7127a72d83d1a2900c824746e921" Content-Transfer-Encoding: quoted-printable

Comments

 [2016-07-14 17:55 UTC] alec (Aleksander Machniak)
-Status: Open +Status: Closed -Assigned To: +Assigned To: alec
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.