summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2016-01-07 21:43:37 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2016-01-07 21:43:37 +0100
commit160a960408857e2a01728e01b22b2f54d0ef3b11 (patch)
tree214bb2f90e2b7ff14702c0048b0f61d49459e401
parentd6c9f9c56c5570e2e3118a05f05cecbc4a062c68 (diff)
downloadbugzilla-160a960408857e2a01728e01b22b2f54d0ef3b11.tar.gz
bugzilla-160a960408857e2a01728e01b22b2f54d0ef3b11.tar.xz
Bug 402039: Exporting CSV from chart.cgi doesn't set mimetype, content_disposition, or filename
r=dkl
-rwxr-xr-xchart.cgi11
1 files changed, 5 insertions, 6 deletions
diff --git a/chart.cgi b/chart.cgi
index 00b0b8ee5..c1bafa117 100755
--- 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());
}