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