Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.6

Bug #11537 Parse failure for filename includes DQuote
Submitted: 2007-07-06 05:15 UTC
From: itam Assigned: alan_k
Status: Closed Package: Mail_mimeDecode (version 1.5.0)
PHP Version: Irrelevant OS: Linux/Windows
Roadmaps: (Not assigned)    
Subscription  


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 48 - 40 = ?

 
 [2007-07-06 05:15 UTC] itam (Masaki Hojo)
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 )

Comments

 [2010-09-02 16:33 UTC] alan_k (Alan Knowles)
-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.