]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1471417 - Remove XUL from attachment Content Type options; add SVG to standard...
authorKohei Yoshino <kohei.yoshino@gmail.com>
Wed, 27 Jun 2018 02:00:02 +0000 (22:00 -0400)
committerDylan William Hardison <dylan@hardison.net>
Wed, 27 Jun 2018 02:00:02 +0000 (22:00 -0400)
Bugzilla/Attachment.pm
extensions/BMO/template/en/default/hook/attachment/createformcontents-mimetypes.html.tmpl [deleted file]
template/en/default/attachment/createformcontents.html.tmpl
template/en/default/attachment/show-multiple.html.tmpl

index 0bdb50c9aea872e0b234577ae1ccfb9ca10f83e8..9eac3a14714295240fa517e518dead877d68e5b0 100644 (file)
@@ -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 (file)
index 3dc727b..0000000
+++ /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
index 61ddceac377e19e5ae2a742ea586149bdc16d2f5..efb24e3e9af1e1a4366e5a44306d25faa2e05b9c 100644 (file)
                   {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"}]
   %]
index c28d5dfd6698768dcc2b2a3cadea4d751d202ef2..6a7bb4b9bb6d8b251465bc32618cb0cde0b921d9 100644 (file)
@@ -35,7 +35,7 @@
 %]
 [% IF hide_obsolete %]
   <div id="hidden_obsolete_message">
-    Obsolete attachments are hidden. To view all attachments (including obsolete) 
+    Obsolete attachments are hidden. To view all attachments (including obsolete)
     <a href="attachment.cgi?bugid=[% bug.id FILTER html %]&amp;action=viewall">click here</a>.
   </div>
 [% END %]
     [% END %]
   [% ELSE %]
     <p><b>
-      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.
       <a href="attachment.cgi?id=[% a.id %]">Download the attachment instead</a>.
     </b></p>
   [% END %]