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 #2542

Subarray in _encodeHeaders causes error

Details

Submitted2004-10-15 20:44 UTC
Frombivaughn at yahoo dot com
StatusNo Feedback
PackageMail_Mime
PHP Version4.3.8
OSMac Os X
Roadmaps(Not assigned)

Comments

[2004-10-15 20:44 UTC] bivaughn at yahoo dot com

Description:
------------
In the case of mimeDecode seeing multiple Received: lines, it will create a sub-array in the $message['headers'] array. When re-encoding this output into a MIME message, _encodeHeaders will complain. The problem is preg_match:

preg_match_all('/(\w*[\x80-\xFF]+\w*)/', $hdr_value, $matches);

Which obviously will not work if $hdr_value is an array.

A quick fix for me was:

if (!is_array($input[$hdr_name])) { preg_match_all('/(\w*[\x80-\xFF]+\w*)/', $hdr_value, $matches); }

Which prevents the check from happening. Hope you guys can provide a more substantial fix!