Bug #4739 [Ver->Csd]: Mail_MimeDecode: d_parameters['filename'] missing

From: Date: Thu, 02 Sep 2010 12:16:42 +0000
Subject: Bug #4739 [Ver->Csd]: Mail_MimeDecode: d_parameters['filename'] missing
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-4732@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=4739&edit=1 ID: 4739 Updated by: alan@akbkhome.com Reported By: cm at data-consult dot de Summary: Mail_MimeDecode: d_parameters['filename'] missing -Status: Verified +Status: Closed Type: Bug Package: Mail_mimeDecode Operating System: Debian Sarge PHP Version: 4.3.10 -Assigned To: +Assigned To: alan_k Roadmap Versions: New Comment: -Status: Verified +Status: Closed -Assigned To: +Assigned To: alan_k Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/ Previous Comments: ------------------------------------------------------------------------ [2010-08-25 02:20:14] alan_k -Status: Open +Status: Verified Patches welcome To fix this a file of an example message would help alot. ------------------------------------------------------------------------ [2010-08-24 13:51:35] sabya I am also facing this problem with ctype_parameters being missing. Try to process a mail which has an attachment with the name: "AbcdAbcdAbc'dA.txt" The ctype_parameters['name'] will not be defined. ------------------------------------------------------------------------ [2006-04-27 10:34:39] cipri Moved to Mail_MimeDecode subpackage. ------------------------------------------------------------------------ [2005-12-16 18:42:24] chris at deskpro dot com I am coming across this problem as well, however in the cases where I find this missing I am finding a ctype_paramters that has the name in it. I am finding this problem on inline attachments in Outlook (e.g. background images). ------------------------------------------------------------------------ [2005-07-04 10:56:40] cm at data-consult dot de Description: ------------ Sometimes the d_parameters['filename'] or ['name'] is missing with the attachment. this happens with utf8 encoded filenames(mostly from M$ clients it seems). without filename im unable to save the file. below is the samplecode i use to save the attachments. i have a testsuite with about 900 mails and this problem exists with more than 10% of these. i've tried this with and without utf8_decode, but the variables are always empty. Reproduce code: --------------- if (isset($part->disposition) and ($part->disposition=='attachment')) { printf(utf8_decode($part->ctype_parameters['name'])."\n"); printf(utf8_decode($part->ctype_parameters['filename'])."\n"); $attachmentfile = fopen($datedir."/".utf8_decode($part->ctype_parameters['name']), 'w'); fwrite($attachmentfile, $part->body); fclose($attachmentfile); } Expected result: ---------------- this is the print_r($part): stdClass Object ( [headers] => Array ( [content-type] => application/PDF [content-disposition] => attachment; filename="Auftragsbestätigung_SO_1312338.pdf" [content-transfer-encoding] => base64 ) [ctype_primary] => application [ctype_secondary] => PDF [disposition] => attachment [d_parameters] => Array ( [filename] => Auftragsbestätigung_SO_1312338.pdf ) [body] => %PDF-1.4M%âãÏÓM so the filename parameter is there. Actual result: -------------- but when i use printf($part->ctype_parameters['filename']."\n"); this variable is empty. ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=4739&edit=1

« previous php.pear.bugs (#4732) next »