From ac88dc8d0918ac5ea6004b9ca05158b00d4bd4ed Mon Sep 17 00:00:00 2001 From: Thomas Bruederli <thomas@roundcube.net> Date: Tue, 27 Nov 2012 12:12:31 -0500 Subject: [PATCH] Don't open application/x-shockwave-flash files in browser (quick fix for XSS reported in #148882) --- program/steps/mail/show.inc | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc index d3b70b4..20e76a6 100644 --- a/program/steps/mail/show.inc +++ b/program/steps/mail/show.inc @@ -52,16 +52,19 @@ $OUTPUT->set_env('permaurl', rcmail_url('show', array('_uid' => $MESSAGE->uid, '_mbox' => $mbox_name))); $OUTPUT->set_env('delimiter', $RCMAIL->storage->get_hierarchy_delimiter()); $OUTPUT->set_env('mailbox', $mbox_name); - if ($CONFIG['drafts_mbox']) { - $OUTPUT->set_env('drafts_mailbox', $CONFIG['drafts_mbox']); - } // mimetypes supported by the browser (default settings) - $mimetypes = $RCMAIL->config->get('client_mimetypes', 'text/plain,text/html,text/xml,image/jpeg,image/gif,image/png,application/x-javascript,application/pdf,application/x-shockwave-flash'); + $mimetypes = $RCMAIL->config->get('client_mimetypes', 'text/plain,text/html,text/xml,image/jpeg,image/gif,image/png,application/x-javascript,application/pdf'); $OUTPUT->set_env('mimetypes', is_string($mimetypes) ? explode(',', $mimetypes) : (array)$mimetypes); + if ($CONFIG['drafts_mbox']) + $OUTPUT->set_env('drafts_mailbox', $CONFIG['drafts_mbox']); if ($CONFIG['trash_mbox']) $OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']); + if ($CONFIG['junk_mbox']) + $OUTPUT->set_env('junk_mailbox', $CONFIG['junk_mbox']); + if ($CONFIG['delete_junk']) + $OUTPUT->set_env('delete_junk', true); if ($CONFIG['flag_for_deletion']) $OUTPUT->set_env('flag_for_deletion', true); if ($CONFIG['read_when_deleted']) -- Gitblit v1.9.1