Bug #55146 [Opn]: iconv_mime_decode_headers() skips some headers
Edit report at https://bugs.php.net/bug.php?id=55146edit=1 ID: 55146 User updated by:dmitry at spamexperts 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: The whole application is using UTF-8 encoding, also if I add iconv_set_encoding('internal_encoding', 'UTF-8'); iconv_set_encoding('input_encoding', 'UTF-8'); iconv_set_encoding('output_encoding', 'UTF-8'); at the beginning of the test script the bug is still actual. Hope that helps, if not - feel free to ask me for any info you need. Thanks! Previous Comments: [2011-07-16 01:33:38] lonnyk at gmail dot com 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! [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: H4sIA+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=55146edit=1
Bug #55146 [Opn]: iconv_mime_decode_headers() skips some headers
Edit report at https://bugs.php.net/bug.php?id=55146edit=1 ID: 55146 User updated by:dmitry at spamexperts 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: If you mean encoding of the X-Header-One header contents (H4sIA+NgFlsCAAA=) - that's just a random set of chars. Previous Comments: [2011-07-16 04:53:55] dmitry at spamexperts dot com The whole application is using UTF-8 encoding, also if I add iconv_set_encoding('internal_encoding', 'UTF-8'); iconv_set_encoding('input_encoding', 'UTF-8'); iconv_set_encoding('output_encoding', 'UTF-8'); at the beginning of the test script the bug is still actual. Hope that helps, if not - feel free to ask me for any info you need. Thanks! [2011-07-16 01:33:38] lonnyk at gmail dot com 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! [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: H4sIA+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=55146edit=1