From 9488a8906592564ec2e7601041f3ea5484cde3cc Mon Sep 17 00:00:00 2001 From: "bbaetz%acm.org" <> Date: Mon, 5 May 2003 08:15:19 +0000 Subject: Bug 201816 - use CGI.pm for header output r=joel, a=justdave --- post_bug.cgi | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'post_bug.cgi') diff --git a/post_bug.cgi b/post_bug.cgi index 37a43afb4..76d86fe58 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -26,6 +26,7 @@ use strict; use lib qw(.); +use Bugzilla; use Bugzilla::Constants; require "CGI.pl"; @@ -55,6 +56,8 @@ use vars qw($vars $template); ConnectToDatabase(); my $whoid = confirm_login(); +my $cgi = Bugzilla->cgi; + # do a match on the fields if applicable &Bugzilla::User::match_field ({ @@ -85,16 +88,17 @@ if (!$product_id) { # Set cookies my $cookiepath = Param("cookiepath"); if (exists $::FORM{'product'}) { - if (exists $::FORM{'version'}) { - print "Set-Cookie: VERSION-$product=$::FORM{'version'} ; " . - "path=$cookiepath ; expires=Sun, 30-Jun-2029 00:00:00 GMT\n"; + if (exists $::FORM{'version'}) { + $cgi->send_cookie(-name => "VERSION-$product", + -value => $cgi->param('version'), + -expires => "Fri, 01-Jan-2038 00:00:00 GMT"); } } if (defined $::FORM{'maketemplate'}) { $vars->{'url'} = $::buffer; - print "Content-type: text/html\n\n"; + print $cgi->header(); $template->process("bug/create/make-template.html.tmpl", $vars) || ThrowTemplateError($template->error()); exit; @@ -491,7 +495,7 @@ if ($::COOKIE{"BUGLIST"}) { } $vars->{'bug_list'} = \@bug_list; -print "Content-type: text/html\n\n"; +print $cgi->header(); $template->process("bug/create/created.html.tmpl", $vars) || ThrowTemplateError($template->error()); -- cgit v1.2.3-24-g4f1b