xref: /PHP-7.1/ext/iconv/tests/bug55146.phpt (revision 6e1980e1)
1--TEST--
2Bug #55146 (iconv_mime_decode_headers() skips some headers)
3--SKIPIF--
4<?php
5if (!extension_loaded('iconv')) die('skip iconv extension not available');
6?>
7--FILE--
8<?php
9
10$headers = <<< HEADERS
11X-Header-One: H4sIAAAAAAAAA+NgFlsCAAA=
12X-Header-Two: XtLePq6GTMn8G68F0
13HEADERS;
14var_dump(iconv_mime_decode_headers($headers, ICONV_MIME_DECODE_CONTINUE_ON_ERROR));
15
16$headers = <<< HEADERS
17X-Header-One: =
18X-Header-Two: XtLePq6GTMn8G68F0
19HEADERS;
20var_dump(iconv_mime_decode_headers($headers, ICONV_MIME_DECODE_STRICT));
21?>
22===DONE===
23--EXPECT--
24array(2) {
25  ["X-Header-One"]=>
26  string(24) "H4sIAAAAAAAAA+NgFlsCAAA="
27  ["X-Header-Two"]=>
28  string(17) "XtLePq6GTMn8G68F0"
29}
30array(2) {
31  ["X-Header-One"]=>
32  string(1) "="
33  ["X-Header-Two"]=>
34  string(17) "XtLePq6GTMn8G68F0"
35}
36===DONE===
37