|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #40462 Add a mode to lowercase header names in iconv_mime_decode_headers()
Submitted: 2007-02-13 14:34 UTC Modified: 2021-03-03 13:36 UTC
Avg. Score:4.0 ± 0.8
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: php-bug-0702 at nico dot edtinger dot at Assigned:
Status: Open Package: ICONV related
PHP Version: 5.2.1 OS: -
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: php-bug-0702 at nico dot edtinger dot at
New email:
PHP Version: OS:


 [2007-02-13 14:34 UTC] php-bug-0702 at nico dot edtinger dot at
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

var_dump(iconv_mime_decode_headers($message, ICONV_MIME_DECODE_LOWER));

Expected result:
array(2) {
  array(4) {
    string(6) "line 1"
    string(6) "line 2"
    string(6) "line 3"
    string(6) "line 4"
  string(4) "test"

Actual result:
// currently not possible - with the default mode:
array(4) {
  string(6) "line 1"
  string(6) "line 2"
  array(2) {
    string(6) "line 3"
    string(6) "line 4"
  string(4) "test"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-05 00:15 UTC]
-Package: Feature/Change Request +Package: ICONV related
 [2021-03-03 13:36 UTC]
Ugh, yeah, that's bad: <>.

At least it is documented now:
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Feb 24 07:01:28 2024 UTC