From 8c5f4055873e171bd4abcd0dfe56a7b3a01f733a Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sat, 23 Nov 2013 07:14:11 -0500
Subject: [PATCH] Set real content-type for file downloads (#1489439)

---
 CHANGELOG                  |    1 +
 program/steps/mail/get.inc |    8 +-------
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index dde12ed..3790c29 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Set real content-type for file downloads (#1489439)
 - Update TinyMCE to version 3.5.10 (#1489442)
 - Fix keyboard navigation in list widgets (#1489392)
 - Allow plugins to grab the reference of opened windows (#1489413)
diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc
index ae48307..be1366d 100644
--- a/program/steps/mail/get.inc
+++ b/program/steps/mail/get.inc
@@ -220,13 +220,7 @@
     $browser = $RCMAIL->output->browser;
     list($ctype_primary, $ctype_secondary) = explode('/', $mimetype);
 
-    // send download headers
-    if ($plugin['download']) {
-      header("Content-Type: application/octet-stream");
-      if ($browser->ie)
-        header("Content-Type: application/force-download");
-    }
-    else if ($ctype_primary == 'text') {
+    if (!$plugin['download'] && $ctype_primary == 'text') {
       header("Content-Type: text/$ctype_secondary; charset=" . ($part->charset ? $part->charset : RCMAIL_CHARSET));
     }
     else {

--
Gitblit v1.9.1