Bug #68821 [Opn->Ver]: Underscores left by mb_decode_mimeheaders
| From: | cmb@php.net | Date: | Thu, 28 May 2015 14:45:52 +0000 |
| Subject: | Bug #68821 [Opn->Ver]: Underscores left by mb_decode_mimeheaders | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-192973@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68821&edit=1
ID: 68821
Updated by: cmb@php.net
Reported by: php dot bohwaz at miam dot kd2 dot org
Summary: Underscores left by mb_decode_mimeheaders
-Status: Open
+Status: Verified
Type: Bug
Package: mbstring related
Operating System: Debian/Linux
PHP Version: 5.4.36
Block user comment: N
Private report: N
New Comment:
Verified: <http://3v4l.org/Rnt2K>. (\x92 and \x96 are
undefined
for ISO-8859-1, what explains their suppression in PHP 5.6 and
HHVM. Anyhow, this is unrelated to the issue at hand.)
Apparently, the issue is with mbfl_mime_header_decode(), and
therefore should be resolved upstream in libmbfl
(<https://github.com/moriyoshi/libmbfl>).
Previous Comments:
------------------------------------------------------------------------
[2015-01-13 03:47:59] php dot bohwaz at miam dot kd2 dot org
Description:
------------
mb_decode_mimeheaders doesn't decode underscores as per the RFC 2047:
"The 8-bit hexadecimal value 20 (e.g., ISO-8859-1 SPACE) may be represented as "_"
(underscore, ASCII 95.). (This character may not pass through some internetwork mail gateways, but
its use will greatly enhance readability of "Q" encoded data with mail readers that do not
support this encoding.) Note that the "_" always represents hexadecimal 20, even if the
SPACE character occupies a different code position in the character set in use."
One example:
Subject: =?ISO-8859-1?Q?spring_into_ALDI_for_this_week=92s_special_buys_fr?=
=?ISO-8859-1?Q?om_thurs_30_sep_=96_hurry,_limited_stocks_in_store?=
Test script:
---------------
<?php
$subject = "=?ISO-8859-1?Q?spring_into_ALDI_for_this_week=92s_special_buys_fr?=
=?ISO-8859-1?Q?om_thurs_30_sep_=96_hurry,_limited_stocks_in_store?=";
echo mb_decode_mimeheaders($subject);
?>
Expected result:
----------------
spring into ALDI for this weeks special buys from thurs 30 sep hurry, limited stocks in store
Actual result:
--------------
spring_into_ALDI_for_this_weeks_special_buys_from_thurs_30_sep__hurry,_limited_stocks_in_store
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68821&edit=1