PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Mail » Mail_Mime » Bug #3488

Header delimiters don't survive in sessions

Details

Submitted2005-02-16 07:11 UTC
Fromsteve at signify dot co dot nz
Assignedsean
StatusClosed
PackageMail_Mime
PHP Version4.3.9
OSDebian 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"