From 5fd2b62a573eb1eaef834367008be0e24e1fca57 Mon Sep 17 00:00:00 2001 From: Albert Ting Date: Sun, 23 Aug 2015 14:16:49 +0200 Subject: Bug 1196517: Properly set the disposition for non-viewable attachments r=LpSolit a=sgreen --- attachment.cgi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'attachment.cgi') diff --git a/attachment.cgi b/attachment.cgi index 7df230d79..e7fadf66f 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 -- cgit v1.2.3-24-g4f1b