PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Mail » Mail_Mime » Bug #1132

Fails to decode attachements with BASE64

Details

Submitted2004-04-05 03:33 UTC
Fromshaun at aegisdesign dot co dot uk
Assignedsean
StatusClosed
PackageMail_Mime
PHP Version4.3.3
OSLinux
Roadmaps(Not assigned)

Comments

[2004-04-05 03:33 UTC] shaun at aegisdesign dot co dot uk

Description:
------------
Sony Ericsson T610 mobile phones send email with
attachments encoded
with uppercase 'BASE64' instead of 'base64'...

eg..

----_MULTIPART_BOUNDARY_189F42D57FDCBA93
Content-Type: TEXT/PLAIN;
charset="ISO-8859-1"
Content-Transfer-Encoding: QUOTED-PRINTABLE

Try this picture
----_MULTIPART_BOUNDARY_189F42D57FDCBA93
Content-Type: IMAGE/JPEG;
name="picture(4).jpg"
Content-Disposition: attachment;
filename="picture(4).jpg"
Content-Transfer-Encoding: BASE64

In mimeDecode.php, function _decodeBody

change the switch to...

switch (strtolower($encoding)) {

and it will decode the attachments correctly.

[2004-05-19 18:41 UTC] pear at woeitje dot com

i had the same problem, spend some hours looking for the bug :(

i added the
switch (strtolower($encoding))
as well => problem solved

btw, thanks for the nice class ;)

[2004-06-04 13:20 UTC] domi at saargate dot de

I can only confirm this problem. To make the needed change more explizit, here is a patch:

--- mimeDecode.php.orig Fri Jun 4 15:29:00 2004
+++ mimeDecode.php Fri Jun 4 15:29:04 2004
@@ -522,7 +522,7 @@
*/
function _decodeBody($input, $encoding = '7bit')
{
- switch ($encoding) {
+ switch (strtolower($encoding)) {
case '7bit':
return $input;
break;

[2004-12-07 20:53 UTC] sean at caedmon dot net

http://rfc.net/rfc2045.html#p14

Indicates that this field is case-insensitive.

S

[2004-12-07 21:06 UTC] sean at caedmon dot net

Was fixed by Urs Gehrig in 1.37
http://cvs.php.net/co.php/pear/Mail_Mime/mimeDecode.php?r=1.37

S