]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1196517: Properly set the disposition for non-viewable attachments
authorAlbert Ting <altlist@gmail.com>
Sun, 23 Aug 2015 12:16:49 +0000 (14:16 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Sun, 23 Aug 2015 12:16:49 +0000 (14:16 +0200)
r=LpSolit a=sgreen

attachment.cgi

index 7df230d793a8c4e264d1efa4964c77c47aae944b..e7fadf66f0cbfe99979d01731d0e933bc8398281 100755 (executable)
@@ -346,7 +346,8 @@ sub view {
     local $Encode::Encoding{'MIME-Q'}->{'bpl'} = 10000;
     $filename = encode('MIME-Q', $filename);
 
-    my $disposition = Bugzilla->params->{'allow_attachment_display'} ? 'inline' : 'attachment';
+    my $disposition = (Bugzilla->params->{'allow_attachment_display'}
+                       && $attachment->is_viewable) ? 'inline' : 'attachment';
 
     # Don't send a charset header with attachments--they might not be UTF-8.
     # However, we do allow people to explicitly specify a charset if they