php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63254 iconv_mime_encode() counts field name in the line-length limit
Submitted: 2012-10-10 14:32 UTC Modified: 2018-08-25 16:07 UTC
Votes:3
Avg. Score:3.3 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: narf at bofh dot bg Assigned: cmb (profile)
Status: Not a bug Package: ICONV related
PHP Version: Irrelevant OS: Linux, Ubuntu
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: narf at bofh dot bg
New email:
PHP Version: OS:

 

 [2012-10-10 14:32 UTC] narf at bofh dot bg
Description:
------------
RFC 2045 specifies that the line-length (an iconv_mime_encode() preference, default 76) applies to all characters in the header's BODY, excluding the CRLF.

iconv_mime_encode() however will count the header name (which it doesn't need to know btw) in it as well. So, if I for example want to create a Subject header, iconv_mime_encode() will effectively give its first line the limit of ...:

default length = 76
-
'Subject: ' length = 9
=
67 characters.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-25 16:07 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2018-08-25 16:07 UTC] cmb@php.net
RFC 2045[1] does not apply to iconv_mime_encode(), since the
function is about encoding MIME *headers*, but the RFC is about
message *bodies*.  Instead RFC 2047[2] is relevant for the
function, and it states in section 2:

| While there is no limit to the length of a multiple-line header
| field, each line of a header field that contains one or more
|'encoded-word's is limited to 76 characters.

So counting the field name length is sensible.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 04:01:36 2025 UTC