|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2018-02-06 11:32 UTC] jochem dot blok at fasterforward dot nl
[2021-09-02 11:52 UTC] cmb@php.net
-Status: Open
+Status: Verified
[2021-09-02 11:52 UTC] cmb@php.net
[2021-09-07 15:05 UTC] cmb@php.net
[2021-09-07 16:49 UTC] cmb@php.net
-Assigned To:
+Assigned To: cmb
[2021-09-07 16:49 UTC] cmb@php.net
[2021-09-08 14:56 UTC] cmb@php.net
[2021-09-08 14:57 UTC] cmb@php.net
-Summary: Mails with header mime-version which end with a
semicolon gets treated as plain
+Summary: Mails with unknown MIME version are treated as
plain/text
[2021-09-20 08:10 UTC] git@php.net
[2021-09-20 08:10 UTC] git@php.net
-Status: Verified
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 14:00:01 2025 UTC |
Description: ------------ We are trying to parse an e-mail with mailparse extension. The header Mime-Version is as follows: "Mime-Version: 1.0;", note the semicolon at the end. Due to this semicolon mailparse treats the mail as text/plain. Test script: --------------- $tekst = 'Mime-Version: 1.0; Content-Type: multipart/Alternative; boundary="=====1473780076CSSSMTP_CLIENT==" --=====1473780076CSSSMTP_CLIENT== Content-Type: text/plain Hello please pay attached invoice --=====1473780076CSSSMTP_CLIENT== Content-Type: text/html; charset=utf-8 Hello please pay attached invoice --=====1473780076CSSSMTP_CLIENT==--'; $stream = fopen('php://memory', 'r+'); fwrite($stream, $tekst); fseek($stream, 0); $resource = mailparse_msg_create(); mailparse_msg_parse($resource, fread($stream, 10000)); $data = mailparse_msg_get_part_data(mailparse_msg_get_part($resource, 1)); print_r($data['content-type']); Expected result: ---------------- multipart/alternative Actual result: -------------- text/plain