]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 402039: Exporting CSV from chart.cgi doesn't set mimetype, content_disposition...
authorFrédéric Buclin <LpSolit@gmail.com>
Thu, 7 Jan 2016 20:45:23 +0000 (21:45 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Thu, 7 Jan 2016 20:45:23 +0000 (21:45 +0100)
r/a=dkl

chart.cgi

index 00b0b8ee5d4d3c7202d0a99a68280105f1c352c7..c1bafa1175cbf0fe5aaa15f6e4988f3677cebdec 100755 (executable)
--- a/chart.cgi
+++ b/chart.cgi
@@ -305,16 +305,15 @@ sub plot {
     $vars->{'chart'} = new Bugzilla::Chart($cgi);
 
     my $format = $template->get_format("reports/chart", "", scalar($cgi->param('ctype')));
+    $format->{'ctype'} = 'text/html' if $cgi->param('debug');
 
-    # Debugging PNGs is a pain; we need to be able to see the error messages
-    if ($cgi->param('debug')) {
-        print $cgi->header();
-        $vars->{'chart'}->dump();
-    }
-
+    $cgi->set_dated_content_disp('inline', 'chart', $format->{extension});
     print $cgi->header($format->{'ctype'});
     disable_utf8() if ($format->{'ctype'} =~ /^image\//);
 
+    # Debugging PNGs is a pain; we need to be able to see the error messages
+    $vars->{'chart'}->dump() if $cgi->param('debug');
+
     $template->process($format->{'template'}, $vars)
       || ThrowTemplateError($template->error());
 }