FAQ
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
)

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedSep 2, '10 at 12:33p
activeSep 2, '10 at 12:33p
posts1
users1
websitepear.php.net

1 user in discussion

Alan: 1 post

People

Translate

site design / logo © 2022 Grokbase