From: Albert Ting Date: Sun, 23 Aug 2015 12:16:49 +0000 (+0200) Subject: Bug 1196517: Properly set the disposition for non-viewable attachments X-Git-Tag: release-5.1.1~185 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fd2b62a573eb1eaef834367008be0e24e1fca57;p=thirdparty%2Fbugzilla.git Bug 1196517: Properly set the disposition for non-viewable attachments r=LpSolit a=sgreen --- diff --git a/attachment.cgi b/attachment.cgi index 7df230d793..e7fadf66f0 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -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