|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-02-21 15:52 UTC] dominik at rangers dot eu dot org
[2006-02-21 15:53 UTC] dominik at rangers dot eu dot org
[2007-04-03 09:20 UTC] barns at uk dot umis dot net
[2008-01-08 15:07 UTC] shire@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 04:00:02 2025 UTC |
Description: ------------ mailparse 2.1.1 When parsing an e-mail where there are multiple headers with the same name, e.g. multiple Received: headers, only the last one remains in the data structure returned by mailparse_msg_get_part_data($section). All others are lost, because it's a string and not an array. For now I'm using PEAR/Mail/mimeDecode.php, which does return an array if multiple headers with the same name are found, but it's much slower. I'd appreciate it if you could fix this quickly. Reproduce code: --------------- $msg = <<<EOD Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat, 18 Feb 2006 22:58:14 -0800 Received: from 66.178.40.49 by BAY116-DAV8.phx.gbl with DAV; Sun, 19 Feb 2006 06:58:13 +0000 test EOD; $mail = mailparse_msg_create(); mailparse_msg_parse($mail,$msg); $struct = mailparse_msg_get_structure($mail); foreach($struct as $st) { $section = mailparse_msg_get_part($mail, $st); $info = mailparse_msg_get_part_data($section); echo "<pre>\n"; var_dump($info); echo "</pre>\n"; } Expected result: ---------------- array(11) { ["headers"]=> array(1) { ["received"]=> array(2) { [0]=> string(95) "from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat, 18 Feb 2006 22:58:14 -0800" [1]=> string(82) "from 66.178.40.49 by BAY116-DAV8.phx.gbl with DAV; Sun, 19 Feb 2006 06:58:13 +0000" } ["starting-pos"]=> int(0) ... } Actual result: -------------- array(11) { ["headers"]=> array(1) { ["received"]=> string(90) "from 66.178.40.49 by BAY116-DAV8.phx.gbl with DAV; Sun, 19 Feb 2006 06:58:13 +0000" } ["starting-pos"]=> int(0) ... }