Bug #11537 [Opn->Csd]: Parse failure for filename includes DQuote

From: Date: Thu, 02 Sep 2010 12:33:26 +0000
Subject: Bug #11537 [Opn->Csd]: Parse failure for filename includes DQuote
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-4734@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=11537&edit=1 ID: 11537 Updated by: alan@akbkhome.com Reported By: itam at itam dot jp Summary: Parse failure for filename includes DQuote -Status: Open +Status: Closed Type: Bug Package: Mail_mimeDecode Operating System: Linux/Windows Package Version: 1.5.0 PHP Version: Irrelevant -Assigned To: +Assigned To: alan_k Roadmap Versions: New Comment: -Status: Open +Status: Closed -Assigned To: +Assigned To: alan_k This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Previous Comments: ------------------------------------------------------------------------ [2007-07-06 01:15:36] itam Description: ------------ Like previous bug report #11263, some attached filename, that includes double-quote char, couldn't be extracted. So, when you decode filename of test script sample by base64, you get Japanese JIS code string includes double-quote char. If decode_headers parameter was false, it works well. I analyzed mimeDecode.php and make patch for this problem. I hope this patch helps to you. Test script: --------------- $aMailContents = array(); $aMailContents[] = 'Content-Type: application/octet-stream;'; $aMailContents[] = ' name="=?ISO-2022-JP?B?GyRCQD1JShsoQkFCQxskQiUiJXMlMSE8JUgbKEI=?='; $aMailContents[] = ' =?ISO-2022-JP?B?LnR4dA==?="'; $aMailContents[] = 'Content-Disposition: attachment;'; $aMailContents[] = ' filename="=?ISO-2022-JP?B?GyRCQD1JShsoQkFCQxskQiUiJXMlMSE8JUgbKEI=?='; $aMailContents[] = ' =?ISO-2022-JP?B?LnR4dA==?="'; $aMailContents[] = ''; $aMailContents[] = 'g0GDk4NQgVuDZw0K'; $aParams = array(); $aParams['decode_headers'] = TRUE; $aParams['include_bodies'] = TRUE; $aParams['decode_bodies'] = TRUE; $aParams['input'] = join("\r\n", $aMailContents); $oMailStructure = Mail_mimeDecode::decode($aParams); print_r($oMailStructure); Expected result: ---------------- stdClass Object ( [headers] => Array ( [content-type] => application/octet-stream; name="»•iABCƒAƒ“ƒP[ƒg.txt" [content-disposition] => attachment; filename="»•iABCƒAƒ“ƒP[ƒg.txt" ) [ctype_primary] => application [ctype_secondary] => octet-stream [ctype_parameters] => Array ( [name] => »•iABCƒAƒ“ƒP[ƒg.txt ) [disposition] => attachment [d_parameters] => Array ( [filename] => »•iABCƒAƒ“ƒP[ƒg.txt ) [body] => g0GDk4NQgVuDZw0K ) Actual result: -------------- stdClass Object ( [headers] => Array ( [content-type] => application/octet-stream; name="»•iABCƒAƒ“ƒP[ƒg.txt" [content-disposition] => attachment; filename="»•iABCƒAƒ“ƒP[ƒg.txt" ) [ctype_primary] => application [ctype_secondary] => octet-stream [disposition] => attachment [body] => g0GDk4NQgVuDZw0K ) ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=11537&edit=1

« previous php.pear.bugs (#4734) next »