diff options
author | thomascube <thomas@roundcube.net> | 2007-11-07 07:34:22 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2007-11-07 07:34:22 +0000 |
commit | a9cc52b1634ab42d6d2c226412d477ef18b6e34f (patch) | |
tree | e4cc05f1df0adb4b2dff1857b0b0eeababb1628e /program/include | |
parent | e4867ea740cd0d03acb65fdc7a93f7764cc711b2 (diff) |
Correctly decode attachments when downloading them (fixes #1484645)
Diffstat (limited to 'program/include')
-rw-r--r-- | program/include/rcube_imap.inc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc index a5258279c..4071dbb21 100644 --- a/program/include/rcube_imap.inc +++ b/program/include/rcube_imap.inc @@ -1201,15 +1201,22 @@ class rcube_imap 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) |