From: php-bug-0702 at nico dot edtinger dot at Operating system: - PHP version: 5.2.1 PHP Bug Type: Feature/Change Request Bug description: Add a mode to lowercase header names in iconv_mime_decode_headers()
Description: ------------ In RFC 822 all header names are defined as case independent. Therefore it would be useful if a mode exists that lowercases all header names and also merge multiple headers with the lowercased name in iconv_mime_decode_header(). It is possible to do that after iconv_mime_decode_header(), but merging multiple headers needs a fair amount of code, which is also already in iconv_mime_decode_header(). Reproduce code: --------------- $message = <<<ETX received: line 1 RECEIVED: line 2 Received: line 3 Subject: test ETX; var_dump(iconv_mime_decode_headers($message, ICONV_MIME_DECODE_LOWER)); Expected result: ---------------- array(2) { ["received"]=> array(4) { [0]=> string(6) "line 1" [1]=> string(6) "line 2" [2]=> string(6) "line 3" [3]=> string(6) "line 4" } ["subject"]=> string(4) "test" } Actual result: -------------- // currently not possible - with the default mode: array(4) { ["received"]=> string(6) "line 1" ["RECEIVED"]=> string(6) "line 2" ["Received"]=> array(2) { [0]=> string(6) "line 3" [1]=> string(6) "line 4" } ["Subject"]=> string(4) "test" } -- Edit bug report at http://bugs.php.net/?id=40462&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40462&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40462&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40462&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40462&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40462&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40462&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40462&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40462&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40462&r=support Expected behavior: http://bugs.php.net/fix.php?id=40462&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40462&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40462&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40462&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40462&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40462&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40462&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40462&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40462&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40462&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40462&r=mysqlcfg