Commit 76d1a3dc authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 1235772: Display all text/* attachments as plain text in the "Details" page

r=gerv
parent 160a9604
......@@ -190,9 +190,12 @@
[% END %]
</a>
</p>
[% ELSIF attachment.contenttype == "text/html" %]
[% ELSIF attachment.contenttype.match('^text/') %]
[%# For security reasons (clickjacking, embedded scripts), we never
# render HTML pages from here. The source code is displayed instead. %]
# render HTML, XML or SVG pages directly. The source code for all
# text/* MIME types is displayed instead. If someone tries to abuse
# Bugzilla by manually editing the MIME type, it will be caught
# by the iframe below, thanks to its 'sandbox' attribute. %]
[% INCLUDE global/textarea.html.tmpl
id = 'viewFrame'
minrows = 10
......@@ -201,6 +204,8 @@
readonly = 'readonly'
%]
[% ELSE %]
[%# The 'sandbox' attribute causes all scripts and form submissions
# embedded in the attachment to be disabled, for security reasons. %]
<iframe id="viewFrame" src="attachment.cgi?id=[% attachment.id %]" sandbox>
<b>You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
<a href="attachment.cgi?id=[% attachment.id %]">View the attachment on a separate page</a>.</b>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment