1--TEST--
2iconv_mime_decode_headers()
3--SKIPIF--
4<?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
5--INI--
6iconv.internal_charset=iso-8859-1
7--FILE--
8<?php
9$headers = <<<HERE
10Return-Path: <internals-return-5651-***=***.example.com@lists.php.net>
11Received: from pb1.pair.com (pb1.pair.com [16.92.131.4]) by ***.example.com
12    (8.12.10/8.12.10/1970-09-30) with SMTP id hALLmpea023899 for
13    <***@***.example.com>; Sat, 22 Jan 1970 06:48:51 +0900 (JST)
14    (envelope-from
15    internals-return-5651-***=***.example.com@lists.php.net)
16Received: (qmail 63472 invoked by uid 1010); 1 Jan 1970 0:00:00 -0000
17Mailing-List: contact internals-help@lists.php.net; run by ezmlm
18Precedence: bulk
19List-Help: <mailto:internals-help@lists.php.net>
20List-Unsubscribe: <mailto:internals-unsubscribe@lists.php.net>
21List-Post: <mailto:internals@lists.php.net>
22Delivered-To: mailing list internals@lists.php.net
23Received: (qmail 63459 invoked by uid 1010); 1 Jan 1970 0:00:00 -0000
24Delivered-To: ezmlm-scan-internals@lists.php.net
25Delivered-To: ezmlm-internals@lists.php.net
26Date: Thu, 1 Jan 1970 00:00:00 -0000 (GMT)
27From: *** *** *** <***@***.example.com>
28X-X-Sender: ***@***.example.com
29To: internals@lists.php.net
30Message-Id: <Pine.LNX.4.58.************@***.example.com>
31MIME-Version: 1.0
32Content-Type: TEXT/PLAIN; charset=US-ASCII
33Subject: [PHP-DEV] [ICONV] test for =?US-ASCII?Q?iconv_mime_decode_headers=28=29?=
34X-UIDL: @eH!!h2:!!EOS!!A_c"!
35HERE;
36var_dump(iconv_mime_decode_headers($headers));
37?>
38--EXPECT--
39array(17) {
40  ["Return-Path"]=>
41  string(57) "<internals-return-5651-***=***.example.com@lists.php.net>"
42  ["Received"]=>
43  array(3) {
44    [0]=>
45    string(259) "from pb1.pair.com (pb1.pair.com [16.92.131.4]) by ***.example.com (8.12.10/8.12.10/1970-09-30) with SMTP id hALLmpea023899 for <***@***.example.com>; Sat, 22 Jan 1970 06:48:51 +0900 (JST) (envelope-from internals-return-5651-***=***.example.com@lists.php.net)"
46    [1]=>
47    string(59) "(qmail 63472 invoked by uid 1010); 1 Jan 1970 0:00:00 -0000"
48    [2]=>
49    string(59) "(qmail 63459 invoked by uid 1010); 1 Jan 1970 0:00:00 -0000"
50  }
51  ["Mailing-List"]=>
52  string(50) "contact internals-help@lists.php.net; run by ezmlm"
53  ["Precedence"]=>
54  string(4) "bulk"
55  ["List-Help"]=>
56  string(37) "<mailto:internals-help@lists.php.net>"
57  ["List-Unsubscribe"]=>
58  string(44) "<mailto:internals-unsubscribe@lists.php.net>"
59  ["List-Post"]=>
60  string(32) "<mailto:internals@lists.php.net>"
61  ["Delivered-To"]=>
62  array(3) {
63    [0]=>
64    string(36) "mailing list internals@lists.php.net"
65    [1]=>
66    string(34) "ezmlm-scan-internals@lists.php.net"
67    [2]=>
68    string(29) "ezmlm-internals@lists.php.net"
69  }
70  ["Date"]=>
71  string(36) "Thu, 1 Jan 1970 00:00:00 -0000 (GMT)"
72  ["From"]=>
73  string(33) "*** *** *** <***@***.example.com>"
74  ["X-X-Sender"]=>
75  string(19) "***@***.example.com"
76  ["To"]=>
77  string(23) "internals@lists.php.net"
78  ["Message-Id"]=>
79  string(44) "<Pine.LNX.4.58.************@***.example.com>"
80  ["MIME-Version"]=>
81  string(3) "1.0"
82  ["Content-Type"]=>
83  string(28) "TEXT/PLAIN; charset=US-ASCII"
84  ["Subject"]=>
85  string(54) "[PHP-DEV] [ICONV] test for iconv mime decode headers()"
86  ["X-UIDL"]=>
87  string(20) "@eH!!h2:!!EOS!!A_c"!"
88}
89
90