Annotation of embedaddon/php/ext/iconv/tests/bug52941.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #52941 (The 'iconv_mime_decode_headers' function is skipping headers)
        !             3: --SKIPIF--
        !             4: <?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
        !             5: --FILE--
        !             6: <?php
        !             7: $headers = <<<HEADERS
        !             8: From: =?UTF-8?B?PGZvb0BleGFtcGxlLmNvbT4=?=
        !             9: Subject: =?ks_c_5601-1987?B?UkU6odk=?=
        !            10: X-Foo: =?ks_c_5601-1987?B?UkU6odk=?= Foo
        !            11: X-Bar: =?ks_c_5601-1987?B?UkU6odk=?= =?UTF-8?Q?Foo?=
        !            12: To: <test@example.com>
        !            13: HEADERS;
        !            14: 
        !            15: $decoded = iconv_mime_decode_headers($headers, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8');
        !            16: 
        !            17: var_dump($decoded['From']);
        !            18: var_dump($decoded['Subject']);
        !            19: var_dump($decoded['X-Foo']);
        !            20: var_dump($decoded['X-Bar']);
        !            21: var_dump($decoded['To']);
        !            22: 
        !            23: $decoded = iconv_mime_decode_headers($headers, ICONV_MIME_DECODE_CONTINUE_ON_ERROR | ICONV_MIME_DECODE_STRICT, 'UTF-8');
        !            24: 
        !            25: var_dump($decoded['From']);
        !            26: var_dump($decoded['Subject']);
        !            27: var_dump($decoded['X-Foo']);
        !            28: var_dump($decoded['X-Bar']);
        !            29: var_dump($decoded['To']);
        !            30: ?>
        !            31: --EXPECTF--
        !            32: string(17) "<foo@example.com>"
        !            33: string(%d) "%s"
        !            34: string(%d) "%sFoo"
        !            35: string(%d) "%sFoo"
        !            36: string(18) "<test@example.com>"
        !            37: string(17) "<foo@example.com>"
        !            38: string(%d) "%s"
        !            39: string(%d) "%sFoo"
        !            40: string(%d) "%sFoo"
        !            41: string(18) "<test@example.com>"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>