Bug #68821 [NEW]: Underscores left by mb_decode_mimeheaders
| From: | php dot bohwaz at miam dot kd2 dot org | Date: | Tue, 13 Jan 2015 03:47:59 +0000 |
| Subject: | Bug #68821 [NEW]: Underscores left by mb_decode_mimeheaders | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-189921@lists.php.net to get a copy of this message | ||
From: php dot bohwaz at miam dot kd2 dot org
Operating system: Debian/Linux
PHP version: 5.4.36
Package: mbstring related
Bug Type: Bug
Bug description:Underscores left by mb_decode_mimeheaders
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 bug report at https://bugs.php.net/bug.php?id=68821&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68821&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68821&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68821&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68821&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68821&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68821&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68821&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68821&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68821&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68821&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68821&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68821&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68821&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68821&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68821&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68821&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68821&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68821&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68821&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68821&r=mysqlcfg