Bug #55146 [Com]: iconv_mime_decode_headers() skips some headers
Edit report at https://bugs.php.net/bug.php?id=55146&edit=1
ID: 55146
Comment by: lonnyk at gmail dot com
Reported by: dmitry at spamexperts dot com
Summary: iconv_mime_decode_headers() skips some headers
Status: Open
Type: Bug
Package: ICONV related
Operating System: Debian Squeeze
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
I am trying to test/fix this, but I do not know what encoding you are trying to
decode this to. Can you please let us know what encoding you are trying to decode
the headers to?
Thank you!
Previous Comments:
------------------------------------------------------------------------
[2011-07-06 08:49:14] dmitry at spamexperts dot com
Description:
------------
If ICONV_MIME_DECODE_CONTINUE_ON_ERROR mode is switched on the mime_decode_headers() function parses
well-formed headers wrongly. Using of ICONV_MIME_DECODE_STRICT mode solve the problem.
Test script:
---------------
<?php
$headers = <<< HEADERS
X-Header-One: H4sIAAAAAAAAA+NgFlsCAAA=
X-Header-Two: XtLePq6GTMn8G68F0
HEADERS;
echo 'Wrong decoding:<br /><pre>';
var_dump(iconv_mime_decode_headers($headers, ICONV_MIME_DECODE_CONTINUE_ON_ERROR));
echo '</pre>';
echo 'Correct decoding:<br /><pre>';
var_dump(iconv_mime_decode_headers($headers, ICONV_MIME_DECODE_STRICT));
echo '</pre>';
Expected result:
----------------
Expected result is shown in the test script under "Correct decoding".
Actual result:
--------------
One header is missing from the result
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55146&edit=1
Thread (8 messages)