icaine / php-mime-mail-parser

Automatically exported from code.google.com/p/php-mime-mail-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

attachment filename decoding

GoogleCodeExporter opened this issue · comments

attachments with mime encoded filename are not decoded.

What steps will reproduce the problem?
1. save an attachment with a decoded filename
2.
3.

What is the expected output? 
obtain the decoded attachment filename

What do you see instead?
the filename of attachment not decoded


What version of the product are you using? On what operating system?
the trunk version, on CENTOS 5.4 with php 5.2.11

Please provide any additional information below.

dump of attachment variable:
array(1) {
  [0]=>
  object(MimeMailParser_attachment)#3 (7) {
    ["filename"]=>
    string(66) "=?Windows-1252?Q?test_filename_test_=80_529=2C24.pdf?="
    ["content_type"]=>
    string(15) "application/pdf"
    ["content:private"]=>
    NULL
    ["extension:private"]=>
    NULL
    ["content_disposition"]=>
    string(10) "attachment"
    ["headers"]=>
    string(1) "J"
    ["stream:private"]=>
    resource(27) of type (stream)
  }
}

Original issue reported on code.google.com by mfris...@tin.it on 13 Nov 2010 at 3:57

proposed solution:

in getAttachments() 
in case of encoded filename 
$part['disposition-filename']=mb_decode_mimeheader($part['disposition-filename']
);

Original comment by mfris...@tin.it on 13 Nov 2010 at 4:00

This issue is reproduced, corrected and tested 
(https://github.com/eXorus/php-mime-mail-parser/issues/4)

You could use my fork if you want : 
https://github.com/eXorus/php-mime-mail-parser

Original comment by eXorus.m...@gmail.com on 28 Jul 2013 at 4:25