|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80259 Bad handling of RFC 2047 in case of folding white space
Submitted: 2020-10-19 21:38 UTC Modified: 2020-10-19 21:57 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: om+bugs dot php dot net at miakinen dot net Assigned:
Status: Verified Package: ICONV related
PHP Version: 7.3 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2020-10-19 21:38 UTC] om+bugs dot php dot net at miakinen dot net
From manual page:

When there is a MIME encoded-word followed by a folding-white-space
(CR+LF+SPACE) followed by a simple word (not MIME encoded-word), the
function iconv_mime_decode doesn't add a space in between.

It works OK without the CR+LF.

My exact PHP version:

PHP 7.2.24-0ubuntu0.18.04.7 (cli) (built: Oct  7 2020 15:24:25) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.24-0ubuntu0.18.04.7, Copyright (c) 1999-2018, by Zend Technologies

Test script:
printf("%s\n", iconv_mime_decode("=?UTF-8?Q?two?= words"));
printf("%s\n", iconv_mime_decode("=?UTF-8?Q?two?=\r\n words"));

Expected result:
two words
two words

Actual result:
two words


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-19 21:57 UTC]
-Status: Open +Status: Verified -Package: *General Issues +Package: ICONV related -PHP Version: 7.2.34 +PHP Version: 7.3
 [2020-10-19 21:57 UTC]
Confirmed: <>.
 [2021-04-14 14:02 UTC]
The following pull request has been associated:

Patch Name: Fix #80259: Bad handling of RFC 2047 in case of folding white space
On GitHub:
 [2022-12-26 08:54 UTC] marlynrasavong at gmail dot com
Have you got solution for this .

 [2023-01-18 05:08 UTC] neskemiquel at gmail dot com
White space is only significant in that indentation of continuation lines is used to indicate a rule definition that spans more than one line.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Feb 08 15:05:48 2023 UTC