]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Fix for bug 171296: changing Content-disposition header in attachment.cgi to use...
authorjustdave%syndicomm.com <>
Sat, 28 Sep 2002 11:10:27 +0000 (11:10 +0000)
committerjustdave%syndicomm.com <>
Sat, 28 Sep 2002 11:10:27 +0000 (11:10 +0000)
doesn't *force* you to download it.
r= bbaetz, bzbarsky

attachment.cgi

index cfdbd4ea6e6b72c5ee00b60df80acc4ecbdbecb4..4d5fea475b8bf3447f7344b01bc33716f27c2dbe 100755 (executable)
@@ -342,17 +342,11 @@ sub view
     SendSQL("SELECT mimetype, filename, thedata FROM attachments WHERE attach_id = $::FORM{'id'}");
     my ($contenttype, $filename, $thedata) = FetchSQLData();
 
-    # Determine if the browser supports the Content-Disposition header or not
-    my $usedisposition = 1; # assume yes, unless we discover otherwise
-    if ($::ENV{HTTP_USER_AGENT} =~ /^Mozilla.*MSIE (\d+)/) {
-        if ($1 < 5) { $usedisposition = 0; } # MSIE < 5.0 chokes on it
-    }
-    
     # Return the appropriate HTTP response headers.
     $filename =~ s/^.*[\/\\]//;
     my $filesize = length($thedata);
     print qq{Content-Type: $contenttype; name="$filename"\n};
-    print qq{Content-Disposition: attachment; filename=$filename\n} if $usedisposition;
+    print qq{Content-Disposition: inline; filename=$filename\n};
     print qq{Content-Length: $filesize\n};
     print qq{\n$thedata};