Home » Mail » Mail_Mime » Bug #3488
Header delimiters don't survive in sessions
Details
| Submitted | 2005-02-16 07:11 UTC |
|---|---|
| From | steve at signify dot co dot nz |
| Assigned | sean |
| Status | Closed |
| Package | Mail_Mime |
| PHP Version | 4.3.9 |
| OS | Debian GNU/Linux |
| Roadmaps | (Not assigned) |
Comments
[2005-02-16 07:11 UTC] steve at signify dot co dot nz
Description:
------------
If a Mail_mime object is stored in a session, the constants MAIL_MIME_CRLF (and MAIL_MIMEPART_CRLF) may not be defined when the object is retrieved.
This results in the mail header separator defaulting to "\r\n".
A workaround is to insert the following line before you do anything with the Mail_mime object:
new Mail_mime("\n");
Which defines the MAIL_MIME_CRLF constant.
Reproduce code:
---------------
(file1.php)
session_start();
$mm = new Mail_mime("\n");
$mm->setHTMLBody('<html></html>');
$mm->setTxtBody('Blah blah');
$_SESSION['mm'] = $mm;
(file2.php)
session_start();
$mm = $_SESSION['mm'];
$mm->get();
$x = $mm->headers();
Expected result:
----------------
$x['Content-Type'] should be split across two lines. The first line should end with just a "\n".
Actual result:
--------------
The first line of $x['Content-Type'] will end with "\r\n"