Commit 2fdc142e authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 402039: Exporting CSV from chart.cgi doesn't set mimetype, content_disposition, or filename

r/a=dkl
parent f6fd37da
...@@ -305,16 +305,15 @@ sub plot { ...@@ -305,16 +305,15 @@ sub plot {
$vars->{'chart'} = new Bugzilla::Chart($cgi); $vars->{'chart'} = new Bugzilla::Chart($cgi);
my $format = $template->get_format("reports/chart", "", scalar($cgi->param('ctype'))); 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 $cgi->set_dated_content_disp('inline', 'chart', $format->{extension});
if ($cgi->param('debug')) {
print $cgi->header();
$vars->{'chart'}->dump();
}
print $cgi->header($format->{'ctype'}); print $cgi->header($format->{'ctype'});
disable_utf8() if ($format->{'ctype'} =~ /^image\//); 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) $template->process($format->{'template'}, $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment