Thomas Bruederli
2014-08-19 fc52af24f1418d6590a2d37a0d8cc31b123e38f6
program/steps/mail/get.inc
@@ -95,9 +95,7 @@
else if (strlen($pid = get_input_value('_part', RCUBE_INPUT_GET))) {
  if ($part = $MESSAGE->mime_parts[$pid]) {
    $ctype_primary = strtolower($part->ctype_primary);
    $ctype_secondary = strtolower($part->ctype_secondary);
    $mimetype = sprintf('%s/%s', $ctype_primary, $ctype_secondary);
    $mimetype = rcmail_fix_mimetype($part->mimetype);
    // allow post-processing of the message body
    $plugin = $RCMAIL->plugins->exec_hook('message_part_get',
@@ -107,7 +105,7 @@
      exit;
    // overwrite modified vars from plugin
    $mimetype = $plugin['mimetype'];
    $mimetype   = $plugin['mimetype'];
    $extensions = rcube_mime::get_mime_extensions($mimetype);
    if ($plugin['body'])
@@ -217,7 +215,6 @@
      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");
    }
@@ -337,7 +334,7 @@
      }
      // send part as-it-is
      else {
        if ($part->body) {
        if ($part->body && empty($plugin['download'])) {
          header("Content-Length: " . strlen($part->body));
          echo $part->body;
          $sent = true;
@@ -347,7 +344,7 @@
            header("Content-Length: $size");
          }
          $sent = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, true);
          $sent = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, true, null, true);
        }
      }