php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #49141 iconv_mime_encode broken by design for some headers
Submitted: 2009-08-03 14:02 UTC Modified: 2009-08-03 16:36 UTC
From: rch at online dot lt Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.2.10 OS: Centos 5.3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rch at online dot lt
New email:
PHP Version: OS:

 

 [2009-08-03 14:02 UTC] rch at online dot lt
Description:
------------
iconv_mime_encode is supposed to compose and return a string that represents a valid MIME  header field.

However, headers like To, CC and others with email addresses don't fit into simple $field_name => $field_value scheme.  Please note that these arguments may contain user submitted data and would contain any characters.

The function should accept extra argument(s) for email addresses, and check/encode characters like "'<> with quoted-printable encoding too, and others if needed, and do not encode ascii strings that should not be encoded.  Please see http://www.faqs.org/rfcs/rfc2822 for valid email header syntax.


Reproduce code:
---------------
---
From manual page: function.iconv-mime-encode
---



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-03 16:36 UTC] moriyoshi@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This function is not designed to encode such headers in the first place. BTW rfc2822 is outdated. RFC5322 is the update.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 14:01:36 2025 UTC