Permalink
Browse files

Add workaround for IE<=8 bug where Content-Disposition:inline was ign…

…ored (#1488844)
  • Loading branch information...
1 parent 9019025 commit 4163511314f54462e0786916bd8683f894fa1885 @alecpl alecpl committed Dec 5, 2012
Showing with 8 additions and 0 deletions.
  1. +1 −0 CHANGELOG
  2. +7 −0 program/steps/mail/get.inc
View
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Add workaround for IE<=8 bug where Content-Disposition:inline was ignored (#1488844)
- Fix XSS vulnerability in vbscript: and data:text links handling (#1488850)
- Fix absolute positioning in HTML messages (#1488819)
- Fix keybord events on messages list in opera browser (#1488823)
@@ -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

0 comments on commit 4163511

Please sign in to comment.