xref: /PHP-8.0/ext/iconv/tests/bug63839.phpt (revision f8d79582)
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--EXPECT--
26array(10) {
27  ["From"]=>
28  string(19) ""xyz" <xyz@xyz.com>"
29  ["To"]=>
30  string(13) "<xyz@xyz.com>"
31  ["Subject"]=>
32  string(35) "Reply Is? white side-LED =? in Help"
33  ["Date"]=>
34  string(16) "Sat, 22 Dec 2012"
35  ["Message-ID"]=>
36  string(32) "<006f01cde00e$d9f79da0$8de6d8e0>"
37  ["MIME-Version"]=>
38  string(3) "1.0"
39  ["Content-Type"]=>
40  string(75) "multipart/alternative; boundary="----=_NextPart_000_0070_01CDE03C.F3AFD9A0""
41  ["X-Mailer"]=>
42  string(29) "Microsoft Office Outlook 12.0"
43  ["Thread-Index"]=>
44  string(32) "Ac3gDtcH2huHjzYcQVmFJPPoWjJogA=="
45  ["Content-Language"]=>
46  string(5) "en-us"
47}
48array(10) {
49  ["From"]=>
50  string(19) ""xyz" <xyz@xyz.com>"
51  ["To"]=>
52  string(13) "<xyz@xyz.com>"
53  ["Subject"]=>
54  string(35) "Reply Is? white side-LED =? in Help"
55  ["Date"]=>
56  string(16) "Sat, 22 Dec 2012"
57  ["Message-ID"]=>
58  string(32) "<006f01cde00e$d9f79da0$8de6d8e0>"
59  ["MIME-Version"]=>
60  string(3) "1.0"
61  ["Content-Type"]=>
62  string(75) "multipart/alternative; boundary="----=_NextPart_000_0070_01CDE03C.F3AFD9A0""
63  ["X-Mailer"]=>
64  string(29) "Microsoft Office Outlook 12.0"
65  ["Thread-Index"]=>
66  string(32) "Ac3gDtcH2huHjzYcQVmFJPPoWjJogA=="
67  ["Content-Language"]=>
68  string(5) "en-us"
69}
70