From c46b694c342da3c1b4e2bb4394ff2886b9bd44f1 Mon Sep 17 00:00:00 2001 From: Kohei Yoshino Date: Tue, 26 Jun 2018 22:00:02 -0400 Subject: Bug 1471417 - Remove XUL from attachment Content Type options; add SVG to standard options; mark PDF viewable --- Bugzilla/Attachment.pm | 6 ++---- .../default/hook/attachment/createformcontents-mimetypes.html.tmpl | 2 -- template/en/default/attachment/createformcontents.html.tmpl | 1 + template/en/default/attachment/show-multiple.html.tmpl | 4 ++-- 4 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 extensions/BMO/template/en/default/hook/attachment/createformcontents-mimetypes.html.tmpl diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index 0bdb50c9a..9eac3a147 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -297,10 +297,8 @@ sub is_viewable { # We assume we can view all text and image types. return 1 if ($contenttype =~ /^(text|image)\//); - # Mozilla can view XUL. Note the trailing slash on the Gecko detection to - # avoid sending XUL to Safari. - return 1 if (($contenttype =~ /^application\/vnd\.mozilla\./) - && ($cgi->user_agent() =~ /Gecko\//)); + # Modern browsers support PDF as well. + return 1 if ($contenttype eq 'application/pdf'); # If it's not one of the above types, we check the Accept: header for any # types mentioned explicitly. diff --git a/extensions/BMO/template/en/default/hook/attachment/createformcontents-mimetypes.html.tmpl b/extensions/BMO/template/en/default/hook/attachment/createformcontents-mimetypes.html.tmpl deleted file mode 100644 index 3dc727b87..000000000 --- a/extensions/BMO/template/en/default/hook/attachment/createformcontents-mimetypes.html.tmpl +++ /dev/null @@ -1,2 +0,0 @@ -[% mimetypes.push({type => "image/svg+xml", desc => "SVG image"}) %] -[% mimetypes.push({type => "application/vnd.mozilla.xul+xml", desc => "XUL"}) %] \ No newline at end of file diff --git a/template/en/default/attachment/createformcontents.html.tmpl b/template/en/default/attachment/createformcontents.html.tmpl index 61ddceac3..efb24e3e9 100644 --- a/template/en/default/attachment/createformcontents.html.tmpl +++ b/template/en/default/attachment/createformcontents.html.tmpl @@ -120,6 +120,7 @@ {type => "image/gif", desc => "GIF image"}, {type => "image/jpeg", desc => "JPEG image"}, {type => "image/png", desc => "PNG image"}, + {type => "image/svg+xml", desc => "SVG image"}, {type => "application/pdf", desc => "PDF document"}, {type => "application/octet-stream", desc => "binary file"}] %] diff --git a/template/en/default/attachment/show-multiple.html.tmpl b/template/en/default/attachment/show-multiple.html.tmpl index c28d5dfd6..6a7bb4b9b 100644 --- a/template/en/default/attachment/show-multiple.html.tmpl +++ b/template/en/default/attachment/show-multiple.html.tmpl @@ -35,7 +35,7 @@ %] [% IF hide_obsolete %]
- Obsolete attachments are hidden. To view all attachments (including obsolete) + Obsolete attachments are hidden. To view all attachments (including obsolete) click here.
[% END %] @@ -106,7 +106,7 @@ [% END %] [% ELSE %]

- Attachment cannot be viewed because its MIME type is not text/*, image/*, or application/vnd.mozilla.*. + Attachment cannot be viewed because its MIME type is not text/*, image/*, or application/pdf. Download the attachment instead.

[% END %] -- cgit v1.2.3-24-g4f1b