diff options
author | bbaetz%acm.org <> | 2003-05-05 10:15:19 +0200 |
---|---|---|
committer | bbaetz%acm.org <> | 2003-05-05 10:15:19 +0200 |
commit | 9488a8906592564ec2e7601041f3ea5484cde3cc (patch) | |
tree | b9308d1a3dcf639d1e561ede1186ff58afc01834 /report.cgi | |
parent | c000c0a480f2cb73f2b0b89550bbd8e496b73c9d (diff) | |
download | bugzilla-9488a8906592564ec2e7601041f3ea5484cde3cc.tar.gz bugzilla-9488a8906592564ec2e7601041f3ea5484cde3cc.tar.xz |
Bug 201816 - use CGI.pm for header output
r=joel, a=justdave
Diffstat (limited to 'report.cgi')
-rwxr-xr-x | report.cgi | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/report.cgi b/report.cgi index d3cde688d..de659ab25 100755 --- a/report.cgi +++ b/report.cgi @@ -26,15 +26,19 @@ use lib "."; require "CGI.pl"; -use vars qw($cgi $template $vars); +use vars qw($template $vars); use Bugzilla; +my $cgi = Bugzilla->cgi; + # Go straight back to query.cgi if we are adding a boolean chart. if (grep(/^cmd-/, $cgi->param())) { my $params = $cgi->canonicalise_query("format", "ctype"); - print "Location: query.cgi?format=" . $cgi->param('query_format') . - ($params ? "&$params" : "") . "\n\n"; + my $location = "query.cgi?format=" . $cgi->param('query_format') . + ($params ? "&$params" : "") . "\n\n"; + + print $cgi->redirect($location); exit; } @@ -52,7 +56,7 @@ my $action = $cgi->param('action') || 'menu'; if ($action eq "menu") { # No need to do any searching in this case, so bail out early. - print "Content-Type: text/html\n\n"; + print $cgi->header(); $template->process("reports/menu.html.tmpl", $vars) || ThrowTemplateError($template->error()); exit; @@ -276,8 +280,8 @@ $format->{'ctype'} = "text/html" if $::FORM{'debug'}; my @time = localtime(time()); my $date = sprintf "%04d-%02d-%02d", 1900+$time[5],$time[4]+1,$time[3]; my $filename = "report-$date.$format->{extension}"; -print "Content-Disposition: inline; filename=$filename\n"; -print "Content-Type: $format->{'ctype'}\n\n"; +print $cgi->header(-type => $format->{'ctype'}, + -content_disposition => "inline; filename=$filename"); # Problems with this CGI are often due to malformed data. Setting debug=1 # prints out both data structures. |