From aa46318265cf588df667d4828e789aeb3a37527e Mon Sep 17 00:00:00 2001 From: "justdave%syndicomm.com" <> Date: Sat, 17 Apr 2004 11:41:14 +0000 Subject: Bug 238865: removing %::FORM from page.cgi in favor of $cgi->param Patch by kiko, r=vlad, justdave, a=justdave --- page.cgi | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'page.cgi') diff --git a/page.cgi b/page.cgi index b68a9313b..6e78317fc 100755 --- a/page.cgi +++ b/page.cgi @@ -42,14 +42,19 @@ Bugzilla->login(); my $cgi = Bugzilla->cgi; -if ($::FORM{'id'}) { +my $id = $cgi->param('id'); +if ($id) { # Remove all dodgy chars, and split into name and ctype. - $::FORM{'id'} =~ s/[^\w\-\.]//g; - $::FORM{'id'} =~ /(.*)\.(.*)/; + $id =~ s/[^\w\-\.]//g; + $id =~ /(.*)\.(.*)/; + if (!$2) { + # if this regexp fails to match completely, something bad came in + ThrowCodeError("bad_page_cgi_id", { "page_id" => $id }); + } my $format = GetFormat("pages/$1", undef, $2); - $vars->{'form'} = \%::FORM; + $cgi->param('id', $id); print $cgi->header($format->{'ctype'}); -- cgit v1.2.3-24-g4f1b