Req #11539 [Opn->Csd]: Full Support of RFC2231 for attach-filename
| From: | alan at akbkhome dot com | Date: | Thu, 02 Sep 2010 13:50:55 +0000 |
| Subject: | Req #11539 [Opn->Csd]: Full Support of RFC2231 for attach-filename | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-4750@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=11539&edit=1
ID: 11539
Updated by: alan@akbkhome.com
Reported By: itam at itam dot jp
Summary: Full Support of RFC2231 for attach-filename
-Status: Open
+Status: Closed
Type: Feature/Change Request
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:52:21] 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
)
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=11539&edit=1