Bug #55146 [NEW]: iconv_mime_decode_headers() skips some headers
| From: | dmitry at spamexperts dot com | Date: | Wed, 06 Jul 2011 12:49:15 +0000 |
| Subject: | Bug #55146 [NEW]: iconv_mime_decode_headers() skips some headers | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-161653@lists.php.net to get a copy of this message | ||
From:
Operating system: Debian Squeeze
PHP version: Irrelevant
Package: ICONV related
Bug Type: Bug
Bug description:iconv_mime_decode_headers() skips some headers
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 bug report at https://bugs.php.net/bug.php?id=55146&edit=1
--
Try a snapshot (PHP 5.2): https://bugs.php.net/fix.php?id=55146&r=trysnapshot52
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55146&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55146&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=55146&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55146&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=55146&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=55146&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=55146&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=55146&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=55146&r=support
Expected behavior: https://bugs.php.net/fix.php?id=55146&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=55146&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=55146&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=55146&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55146&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55146&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=55146&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=55146&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=55146&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=55146&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=55146&r=mysqlcfg
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55146&r=trysnapshot54