summaryrefslogtreecommitdiff
path: root/roundcubemail
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2007-11-07 07:34:22 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2007-11-07 07:34:22 +0000
commit337ca0d3d87827543be1bd72be3c58acaa33bf44 (patch)
tree81e3fea49054100e865bef76b52c11cfec19eea0 /roundcubemail
parent8c0424ac4a4a8c794319afbb5b77e0712f48ff65 (diff)
Correctly decode attachments when downloading them (fixes #1484645)
git-svn-id: https://svn.roundcube.net/trunk@912 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail')
-rw-r--r--roundcubemail/CHANGELOG1
-rw-r--r--roundcubemail/program/include/rcube_imap.inc13
-rw-r--r--roundcubemail/program/steps/mail/get.inc2
3 files changed, 12 insertions, 4 deletions
diff --git a/roundcubemail/CHANGELOG b/roundcubemail/CHANGELOG
index 997c235dc..02889bdda 100644
--- a/roundcubemail/CHANGELOG
+++ b/roundcubemail/CHANGELOG
@@ -6,6 +6,7 @@ CHANGELOG RoundCube Webmail
- 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)
----------
diff --git a/roundcubemail/program/include/rcube_imap.inc b/roundcubemail/program/include/rcube_imap.inc
index a5258279c..4071dbb21 100644
--- a/roundcubemail/program/include/rcube_imap.inc
+++ b/roundcubemail/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)
diff --git a/roundcubemail/program/steps/mail/get.inc b/roundcubemail/program/steps/mail/get.inc
index 880baa38b..c9e40ac77 100644
--- a/roundcubemail/program/steps/mail/get.inc
+++ b/roundcubemail/program/steps/mail/get.inc
@@ -111,7 +111,7 @@ else if ($pid = get_input_value('_part', RCUBE_INPUT_GET))
$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;