xref: /PHP-8.0/ext/iconv/tests/bug55146.phpt (revision a555cc0b)
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--EXPECT--
23array(2) {
24  ["X-Header-One"]=>
25  string(24) "H4sIAAAAAAAAA+NgFlsCAAA="
26  ["X-Header-Two"]=>
27  string(17) "XtLePq6GTMn8G68F0"
28}
29array(2) {
30  ["X-Header-One"]=>
31  string(1) "="
32  ["X-Header-Two"]=>
33  string(17) "XtLePq6GTMn8G68F0"
34}
35