#32311 [Fbk->Opn]: mb_encode_mimeheader does not properly escape characters
| From: | mortoray at ecircle-ag dot com | Date: | Wed, 16 Mar 2005 06:11:04 +0000 |
| Subject: | #32311 [Fbk->Opn]: mb_encode_mimeheader does not properly escape characters | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-75388@lists.php.net to get a copy of this message | ||
ID: 32311
User updated by: mortoray at ecircle-ag dot com
Reported By: mortoray at ecircle-ag dot com
-Status: Feedback
+Status: Open
Bug Type: mbstring related
Operating System: Windows2000
PHP Version: 4.3.10
New Comment:
The snapshop provided does not contain an php_mbstring.dll, and thus
this function does not appear to be defined.... (Windows ZIP)
Previous Comments:
------------------------------------------------------------------------
[2005-03-16 00:58:48] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2005-03-15 10:30:51] mortoray at ecircle-ag dot com
Description:
------------
At least for Q encoding, this function is unsafe and does not encode
correctly. Raw characters which appear as RFC2047 sequences are simply
left as is.
Ex:
mb_encode_mimeheader( '=?iso-8859-1?q?this=20is=20some=20text?=' );
returns '=?iso-8859-1?q?this=20is=20some=20text?='
The exact same string, which is obviously not the encoding for the
source string. That is, mb_encode_mimeheader does not do any type of
escaping.
That is, the following condition is not always true:
mb_decode_mimeheader( mb_encode_mimeheader( $text ) ) == $text
Reproduce code:
---------------
$text = '=?iso-8859-1?q?this=20is=20some=20text?=';
assert( mb_decode_mimeheader( mb_encode_mimeheader( $text ) ) == $text
);
Expected result:
----------------
The decode/encode sequence should always return the original text.
Actual result:
--------------
Returned result is different than original (that is, the assertion
fails).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32311&edit=1