|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-17 18:09 UTC] iliaa@php.net
[2005-03-18 09:13 UTC] mortoray at ecircle-ag dot com
[2005-03-24 00:48 UTC] moriyoshi@php.net
[2005-03-24 01:00 UTC] moriyoshi@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
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).