Home » Mail » Mail_Mime » Bug #2542
Subarray in _encodeHeaders causes error
Details
| Submitted | 2004-10-15 20:44 UTC |
|---|---|
| From | bivaughn at yahoo dot com |
| Status | No Feedback |
| Package | Mail_Mime |
| PHP Version | 4.3.8 |
| OS | Mac 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!