|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-11-23 11:35 UTC] aharvey@php.net
[2010-11-23 11:36 UTC] aharvey@php.net
-Status: Open
+Status: Suspended
-Assigned To:
+Assigned To: aharvey
[2010-11-23 11:36 UTC] aharvey@php.net
[2010-12-13 09:38 UTC] aharvey@php.net
[2010-12-13 09:38 UTC] aharvey@php.net
-Status: Suspended
+Status: Closed
[2010-12-13 09:38 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 08:00:01 2025 UTC |
Description: ------------ Function imap_mime_header_decode() doesn't respect \t (HTAB) characters marking continuation of header defined in RFC822 as one of the LWSP chars, however SPACE is still ignored. Source string: {{{ public 'subject' => string '=?utf-8?B?V3VzaHUgaW5mb3JtIC0gU2FjZW5zaWJhcyBJZ2F1bmk=?= =?utf-8?B?amEgKFRhbGxpbmEpLCDRgdC+0YDQtdCy0L3QvtCy0LDQvdC40Y8g0LIg0KLQsNC7?= =?utf-8?B?0LvQuNC90LUgMTEg0LTQtdC60LDQsdGA0Y8=?=' (length=182) }}} where spaces between =?...?= lines are actually tabs, results to {{{ array 0 => object(stdClass)[54] public 'charset' => string 'utf-8' (length=5) public 'text' => string 'Wushu inform - Sacensibas Igauni' (length=32) 1 => object(stdClass)[53] public 'charset' => string 'default' (length=7) public 'text' => string ' ' (length=1) 2 => object(stdClass)[55] public 'charset' => string 'utf-8' (length=5) public 'text' => string 'ja (Tallina), соревнования в Тал' (length=48) 3 => object(stdClass)[56] public 'charset' => string 'default' (length=7) public 'text' => string ' ' (length=1) 4 => object(stdClass)[57] public 'charset' => string 'utf-8' (length=5) public 'text' => string 'лине 11 декабря' (length=26) }}} This produces: {{{ Wushu inform - Sacensibas Igauni ja (Tallina), соревнования в Тал лине 11 декабря }}} with unwanted spaces in words "Igauni ja" and "Тал лине". Test script: --------------- $str = "=?utf-8?B?V3VzaHUgaW5mb3JtIC0gU2FjZW5zaWJhcyBJZ2F1bmk=?=" ."\t=?utf-8?B?amEgKFRhbGxpbmEpLCDRgdC+0YDQtdCy0L3QvtCy0LDQvdC40Y8g0LIg0KLQsNC7?=" ."\t=?utf-8?B?0LvQuNC90LUgMTEg0LTQtdC60LDQsdGA0Y8=?="; var_dump(imap_mime_header_decode($str)); var_dump(imap_mime_header_decode(str_replace("\t", " ", $str))) Expected result: ---------------- array 0 => object(stdClass)[5] public 'charset' => string 'utf-8' (length=5) public 'text' => string 'Wushu inform - Sacensibas Igauni' (length=32) 1 => object(stdClass)[4] public 'charset' => string 'utf-8' (length=5) public 'text' => string 'ja (Tallina), б�аОб�аЕаВаНаОаВаАаНаИб� аВ аЂаАаЛ' (length=48) 2 => object(stdClass)[3] public 'charset' => string 'utf-8' (length=5) public 'text' => string 'аЛаИаНаЕ 11 аДаЕаКаАаБб�б�' (length=26) Actual result: -------------- array 0 => object(stdClass)[1] public 'charset' => string 'utf-8' (length=5) public 'text' => string 'Wushu inform - Sacensibas Igauni' (length=32) 1 => object(stdClass)[2] public 'charset' => string 'default' (length=7) public 'text' => string ' ' (length=1) 2 => object(stdClass)[3] public 'charset' => string 'utf-8' (length=5) public 'text' => string 'ja (Tallina), б�аОб�аЕаВаНаОаВаАаНаИб� аВ аЂаАаЛ' (length=48) 3 => object(stdClass)[4] public 'charset' => string 'default' (length=7) public 'text' => string ' ' (length=1) 4 => object(stdClass)[5] public 'charset' => string 'utf-8' (length=5) public 'text' => string 'аЛаИаНаЕ 11 аДаЕаКаАаБб�б�' (length=26)