diff options
author | justdave%syndicomm.com <> | 2004-04-17 13:41:14 +0200 |
---|---|---|
committer | justdave%syndicomm.com <> | 2004-04-17 13:41:14 +0200 |
commit | aa46318265cf588df667d4828e789aeb3a37527e (patch) | |
tree | a2b16eac6c1f3cb78e8634a961eac9e8cad5dfc1 /page.cgi | |
parent | bfa503a07fb840d32369a3399821c71dd380445f (diff) | |
download | bugzilla-aa46318265cf588df667d4828e789aeb3a37527e.tar.gz bugzilla-aa46318265cf588df667d4828e789aeb3a37527e.tar.xz |
Bug 238865: removing %::FORM from page.cgi in favor of $cgi->param
Patch by kiko, r=vlad, justdave, a=justdave
Diffstat (limited to 'page.cgi')
-rwxr-xr-x | page.cgi | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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'}); |