Browse Source

- Add workaround for some Outlook's wrong content-types, per discussion in #1487051

release-0.6
alecpl 15 years ago
parent
commit
e0bd7054b7
  1. 10
      program/steps/mail/func.inc
  2. 1
      program/steps/mail/get.inc
  3. 2
      program/steps/mail/show.inc

10
program/steps/mail/func.inc

@ -1717,6 +1717,16 @@ function rcmail_user_date()
return $date;
}
// Fixes some content-type names
function rcmail_fix_mimetype($name)
{
// Some versions of Outlook create garbage Content-Type:
// application/pdf.A520491B_3BF7_494D_8855_7FAC2C6C0608
if (preg_match('/^application\/pdf.+/', $name))
$name = 'application/pdf';
return $name;
}
function rcmail_search_filter($attrib)
{

1
program/steps/mail/get.inc

@ -91,6 +91,7 @@ else if ($pid = get_input_value('_part', RCUBE_INPUT_GET)) {
header("Content-Type: text/$ctype_secondary; charset=" . ($part->charset ? $part->charset : RCMAIL_CHARSET));
}
else {
$mimetype = rcmail_fix_mimetype($mimetype);
header("Content-Type: $mimetype");
header("Content-Transfer-Encoding: binary");
}

2
program/steps/mail/show.inc

@ -172,7 +172,7 @@ function rcmail_message_attachments($attrib)
'return %s.command(\'load-attachment\',{part:\'%s\', mimetype:\'%s\'},this)',
JS_OBJECT_NAME,
$attach_prop->mime_id,
$attach_prop->mimetype),
rcmail_fix_mimetype($attach_prop->mimetype)),
'title' => Q($title),
),
Q($filename)));

Loading…
Cancel
Save