Bug #80259 [NEW]: Bad handling of RFC 2047 in case of folding white space
From: om+bugs dot php dot net at miakinen dot net
Operating system: Linux
PHP version: 7.2.34
Package: *General Issues
Bug Type: Bug
Bug description:Bad handling of RFC 2047 in case of folding white space
Description:
------------
---
From manual page: https://php.net/function.iconv-mime-decode
---
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:
---------------
<?php
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
twowords
--
Edit bug report at https://bugs.php.net/bug.php?id=80259&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80259&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80259&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80259&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80259&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80259&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80259&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80259&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80259&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80259&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80259&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80259&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80259&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80259&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80259&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80259&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80259&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80259&r=mysqlcfg
Thread (8 messages)
- om+bugs dot php dot net at miakinen dot net