xref: /PHP-8.2/ext/iconv/tests/bug63839.phpt (revision e9f783fc)
1--TEST--
2Bug #63839 (iconv_mime_decode_headers function is skipping headers)
3--EXTENSIONS--
4iconv
5--FILE--
6<?php
7$headers = 'From: "xyz" <xyz@xyz.com>
8To: <xyz@xyz.com>
9Subject: Reply Is? white side-LED =? in Help
10Date: Sat, 22 Dec 2012
11Message-ID: <006f01cde00e$d9f79da0$8de6d8e0>
12MIME-Version: 1.0
13Content-Type: multipart/alternative;
14    boundary="----=_NextPart_000_0070_01CDE03C.F3AFD9A0"
15X-Mailer: Microsoft Office Outlook 12.0
16Thread-Index: Ac3gDtcH2huHjzYcQVmFJPPoWjJogA==
17Content-Language: en-us
18
19';
20var_dump(iconv_mime_decode_headers($headers, ICONV_MIME_DECODE_CONTINUE_ON_ERROR));
21var_dump(iconv_mime_decode_headers($headers, ICONV_MIME_DECODE_STRICT));
22?>
23--EXPECT--
24array(10) {
25  ["From"]=>
26  string(19) ""xyz" <xyz@xyz.com>"
27  ["To"]=>
28  string(13) "<xyz@xyz.com>"
29  ["Subject"]=>
30  string(35) "Reply Is? white side-LED =? in Help"
31  ["Date"]=>
32  string(16) "Sat, 22 Dec 2012"
33  ["Message-ID"]=>
34  string(32) "<006f01cde00e$d9f79da0$8de6d8e0>"
35  ["MIME-Version"]=>
36  string(3) "1.0"
37  ["Content-Type"]=>
38  string(75) "multipart/alternative; boundary="----=_NextPart_000_0070_01CDE03C.F3AFD9A0""
39  ["X-Mailer"]=>
40  string(29) "Microsoft Office Outlook 12.0"
41  ["Thread-Index"]=>
42  string(32) "Ac3gDtcH2huHjzYcQVmFJPPoWjJogA=="
43  ["Content-Language"]=>
44  string(5) "en-us"
45}
46array(10) {
47  ["From"]=>
48  string(19) ""xyz" <xyz@xyz.com>"
49  ["To"]=>
50  string(13) "<xyz@xyz.com>"
51  ["Subject"]=>
52  string(35) "Reply Is? white side-LED =? in Help"
53  ["Date"]=>
54  string(16) "Sat, 22 Dec 2012"
55  ["Message-ID"]=>
56  string(32) "<006f01cde00e$d9f79da0$8de6d8e0>"
57  ["MIME-Version"]=>
58  string(3) "1.0"
59  ["Content-Type"]=>
60  string(75) "multipart/alternative; boundary="----=_NextPart_000_0070_01CDE03C.F3AFD9A0""
61  ["X-Mailer"]=>
62  string(29) "Microsoft Office Outlook 12.0"
63  ["Thread-Index"]=>
64  string(32) "Ac3gDtcH2huHjzYcQVmFJPPoWjJogA=="
65  ["Content-Language"]=>
66  string(5) "en-us"
67}
68