Ticket #1484198: PATCH_get.inc

File PATCH_get.inc, 1.6 KB (added by crichardson, 3 years ago)

patch to /program/steps/mail/get.inc

Line 
1Index: program/steps/mail/get.inc
2===================================================================
3--- program/steps/mail/get.inc  (revision 502)
4+++ program/steps/mail/get.inc  (working copy)
5@@ -67,15 +67,26 @@
6     if ($_GET['_download'])
7       {
8       // send download headers
9-      header("Content-Type: application/octet-stream");
10-      header(sprintf('Content-Disposition: attachment; filename="%s"',
11-                     $filename ? rcube_imap::decode_mime_string($filename) : "roundcube.$ctype_secondary"));
12-      }
13+       header("Pragma: public");
14+       header("Expires: 0");
15+       header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
16+       header("Cache-Control: private",false);
17+       header("Content-Type: application/octet-stream");
18+        header(sprintf('Content-Disposition: attachment; filename="%s";',
19+       $filename ? rcube_imap::decode_mime_string($filename) : "roundcube.$ctype_secondary"));
20+       header("Content-Transfer-Encoding: binary");
21+}
22+
23+
24     else
25       {
26-      header("Content-Type: $mimetype");
27-      header(sprintf('Content-Disposition: inline; filename="%s"', rcube_imap::decode_mime_string($filename)));
28-      }
29+        header("Expires: 0");
30+        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
31+        header("Cache-Control: private",false);
32+        header("Content-Type: $mimetype");
33+        header("Content-Transfer-Encoding: binary");
34+        header(sprintf('Content-Disposition: attachment; filename="%s";', rcube_imap::decode_mime_string($filename)));
35+}
36 
37     // We need to set the following headers to make downloads work using IE in HTTPS mode.
38     if (isset($_SERVER['HTTPS']))