thomascube
2007-11-07 a9cc52b1634ab42d6d2c226412d477ef18b6e34f
Correctly decode attachments when downloading them (fixes #1484645)

3 files modified
16 ■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/include/rcube_imap.inc 13 ●●●● patch | view | raw | blame | history
program/steps/mail/get.inc 2 ●●● patch | view | raw | blame | history
CHANGELOG
@@ -6,6 +6,7 @@
- Switch to/from when searcing in Sent folder (#1484555)
- Correctly read the References header (#1484646)
- Unset old cookie in before sending a new value (#1484639)
- Correctly decode attachments when downloading them (#1484645 and #1484642)
2007/10/22 (tomekp)
----------
program/include/rcube_imap.inc
@@ -1201,15 +1201,22 @@
    if ($print)
      {
      iil_C_HandlePartBody($this->conn, $this->mailbox, $msg_id, $part, ($o_part->encoding=='base64'?3:2));
      $body = TRUE;
      $mode = $o_part->encoding == 'base64' ? 3 : ($o_part->encoding == 'quoted-printable' ? 1 : 2);
      $body = iil_C_HandlePartBody($this->conn, $this->mailbox, $msg_id, $part, $mode);
      // we have to decode the part manually before printing
      if ($mode == 1)
        {
        echo $this->mime_decode($body, $o_part->encoding);
        $body = true;
        }
      }
    else
      {
      $body = iil_C_HandlePartBody($this->conn, $this->mailbox, $msg_id, $part, 1);
      // decode part body
      if ($o_part->encoding=='base64' || $o_part->encoding=='quoted-printable')
      if ($o_part->encoding)
        $body = $this->mime_decode($body, $o_part->encoding);
      // convert charset (if text or message part)
program/steps/mail/get.inc
@@ -111,7 +111,7 @@
                     $part->filename ? $part->filename : "roundcube.$ctype_secondary"));
      // turn off output buffering and print part content
      $IMAP->get_message_part($MESSAGE['UID'], $part->mime_id, $part->encoding, true);
      $IMAP->get_message_part($MESSAGE['UID'], $part->mime_id, $part, true);
      }
    exit;