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

Bug #719 Output of MIME_RFC822::parseAddressList() wrong in some case
Submitted: 2004-02-09 18:50 UTC
From: etienne dot goyer at linuxquebec dot com Assigned: chagenbu
Status: Closed Package: Mail
PHP Version: 4.3.1 OS: Linux RedHat 7.3
Roadmaps: (Not assigned)    
Subscription  


 [2004-02-09 18:50 UTC] etienne dot goyer at linuxquebec dot com
Description: ------------ When the 'From:' header wrap on three lines, the output of MIME_RFC822::parseAddressList() is wrong. We expect an associative array with members such as 'personnal', 'comment', etc. It output a plain, non-associative array instead. Reproduce code: --------------- <?php include_once 'Mail/RFC822.php'; $headers = array('From' => '=?iso8859-1?b?Rmlyc3QtTmFtZS13aXRoLThiaXQt6enpIA==?= =?iso8859-1?b?TGFzdC1OYW1lLVdpdGgtOGJpdC3g4OA=?= <first-name-with-8bit.last-name-with-8bit@example.com>'); foreach ($headers as $key => $val) { $from_arr = Mail_RFC822::parseAddressList($val, 'localhost', false); print_r($from_arr); } ?> Expected result: ---------------- Array ( [0] => stdClass Object ( [personal] => =?iso8859-1?b?Rmlyc3QtTmFtZS13aXRoLThiaXQt6enpIA==?= =?iso8859-1?b?TGFzdC1OYW1lLVdpdGgtOGJpdC3g4OA=?= [comment] => Array ( ) [mailbox] => first-name-with-8bit.last-name-with-8bit [host] => example.com ) ) Actual result: -------------- Array ( [0] => =?iso8859-1?b?Rmlyc3QtTmFtZS13aXRoLThiaXQt6enpIA==?= =?iso8859-1?b?TGFzdC1OYW1lLVdpdGgtOGJpdC3g4OA=?= <first-name-with-8bit.last-name-with-8bit@example.com> )

Comments

 [2004-02-24 04:33 UTC] chagenbu at php dot net
This fixes the problem, for me: // Unfold long lines. $this->address = str_replace(array("\r\n", "\n", "\r"), array(' ', ' ', ' '), $this->address); (put that at line 183, at least for me, in RFC822.php - right before while ($this->address = $this->_splitAddresses($this->address)) {, etc.). However, I'm unclear if this would have other repercussions, so I haven't committed it yet. I'd like to hear from a few people on whether or not this would break things.
 [2004-12-22 00:48 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-12-27 17:04 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!