From 4163511314f54462e0786916bd8683f894fa1885 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 5 Dec 2012 09:46:03 +0100 Subject: Add workaround for IE<=8 bug where Content-Disposition:inline was ignored (#1488844) --- program/steps/mail/get.inc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'program/steps/mail/get.inc') diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc index 924433df3..2cc2f12ca 100644 --- a/program/steps/mail/get.inc +++ b/program/steps/mail/get.inc @@ -150,6 +150,13 @@ else if (strlen($pid = get_input_value('_part', RCUBE_INPUT_GET))) { $disposition = !empty($plugin['download']) ? 'attachment' : 'inline'; + // Workaround for nasty IE bug (#1488844) + // If Content-Disposition header contains string "attachment" e.g. in filename + // IE handles data as attachment not inline + if ($disposition == 'inline' && $browser->ie && $browser->ver < 9) { + $filename = str_ireplace('attachment', 'attach', $filename); + } + header("Content-Disposition: $disposition; filename=\"$filename\""); // do content filtering to avoid XSS through fake images -- cgit v1.2.3