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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
38 + 36 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 22:01:28 2024 UTC