|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-11-20 14:58 UTC] anrdaemon at freemail dot ru
[2021-03-02 12:53 UTC] cmb@php.net
-Status: Open
+Status: Verified
[2021-03-02 12:53 UTC] cmb@php.net
[2023-05-24 07:48 UTC] mybesthomedesigns at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 08:00:01 2025 UTC |
Description: ------------ PHP Version => 5.2.6 Extension Version => 2.1.5-dev Revision => $Revision: 1.56 $ Message consist of *two* strings, CRLF delimited. First string looks like header, but second string immediately following it without required delimiter. To: "Daemon" <Daemon@daemon2.darkdragon> It has been made known to me that inside each of us, the Light resides... Reproduce code: --------------- <?php $buffer = "To: my@localhost\r\nHello myself!\r\n"; $msg = mailparse_msg_create(); if(mailparse_msg_parse($msg, $buffer)) { $rc = mailparse_msg_get_structure($msg); $_rc = var_export($rc, true); echo "---------- message structure ----------\n{$_rc}\n"; foreach($rc as $section) { $part = mailparse_msg_get_part($msg, $section); $data = mailparse_msg_get_part_data($part); $_d = var_export($data, true); echo "---------- section {$section} details ----------\n{$_d}\n"; $body = mailparse_msg_extract_part($part, $buffer, NULL); echo "---------- section {$section} body ----------\n{$body}\n---------- section {$section} end ----------\n"; } } ?> Expected result: ---------------- Error in parsing or at least no header in structure. Actual result: -------------- ---------- message structure ---------- array ( 0 => '1', ) ---------- section 1 details ---------- array ( 'headers' => array ( 'to' => 'my@localhost', ), 'starting-pos' => 0, 'starting-pos-body' => 0, 'ending-pos' => 33, 'ending-pos-body' => 31, 'line-count' => 2, 'body-line-count' => 0, 'charset' => 'us-ascii', 'transfer-encoding' => '8bit', 'content-type' => 'text/plain; (error)', 'content-base' => '/', ) ---------- section 1 body ---------- To: my@localhost Hello myself! ---------- section 1 end ----------