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

Request #11539 Full Support of RFC2231 for attach-filename
Submitted: 2007-07-06 05:52 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 : 50 + 7 = ?

 
 [2007-07-06 05:52 UTC] itam (itam)
Description: ------------ Like previous bug report #9616, some attached filename, that is made by the scheme of RFC2231, couldn't be extracted. So, when you decode filename of test script sample, you get nothing else. I make patch for this problem. I hope this patch helps to you. NOTICE: The patch assume that my previous patch of #11537 was already applied. Test script: --------------- $aMailContents = array(); $aMailContents[] = 'Content-Type: application/octet-stream;'; $aMailContents[] = ' name*0*=iso-2022-jp\'\'%1B%24B%40%3DIJ%1B%28BABC%1B%24B%25%22%25s%251%21%3C%1B%28B;'; $aMailContents[] = ' name*1*=%1B%24B%25H%1B%28B%2Etxt'; $aMailContents[] = 'Content-Disposition: attachment;'; $aMailContents[] = ' filename*0*=iso-2022-jp\'\'%1B%24B%40%3DIJ%1B%28BABC%1B%24B%25%22%25s%251%21%3C%1B%28B;'; $aMailContents[] = ' filename*1*=%1B%24B%25H%1B%28B%2Etxt'; $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*0*=iso-2022-jp''%1B%24B%40%3DIJ%1B%28BABC%1B%24B%25%22%25s%251%21%3C%1B%28B; name*1*=%1B%24B%25H%1B%28B%2Etxt [content-disposition] => attachment; filename*0*=iso-2022-jp''%1B%24B%40%3DIJ%1B%28BABC%1B%24B%25%22%25s%251%21%3C%1B%28B; filename*1*=%1B%24B%25H%1B%28B%2Etxt ) [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*0*=iso-2022-jp''%1B%24B%40%3DIJ%1B%28BABC%1B%24B%25%22%25s%251%21%3C%1B%28B; name*1*=%1B%24B%25H%1B%28B%2Etxt [content-disposition] => attachment; filename*0*=iso-2022-jp''%1B%24B%40%3DIJ%1B%28BABC%1B%24B%25%22%25s%251%21%3C%1B%28B; filename*1*=%1B%24B%25H%1B%28B%2Etxt ) [ctype_primary] => application [ctype_secondary] => octet-stream [ctype_parameters] => Array ( [name*0*] => iso-2022-jp''%1B%24B%40%3DIJ%1B%28BABC%1B%24B%25%22%25s%251%21%3C%1B%28B [name*1*] => %1B%24B%25H%1B%28B%2Etxt ) [disposition] => attachment [d_parameters] => Array ( [filename*0*] => iso-2022-jp''%1B%24B%40%3DIJ%1B%28BABC%1B%24B%25%22%25s%251%21%3C%1B%28B [filename*1*] => %1B%24B%25H%1B%28B%2Etxt ) [body] => g0GDk4NQgVuDZw0K )

Comments

 [2010-09-02 17:50 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.