Commit 04705e88 authored by travis%sedsystems.ca's avatar travis%sedsystems.ca

Bug 238866 : remove %FORM from query.cgi

Patch by Teemu Mannermaa <wicked@etlicon.fi> r=gerv a=justdave
parent 4d718011
...@@ -49,7 +49,6 @@ use vars qw( ...@@ -49,7 +49,6 @@ use vars qw(
@log_columns @log_columns
%versions %versions
%components %components
%FORM
$template $template
$vars $vars
); );
...@@ -57,7 +56,7 @@ use vars qw( ...@@ -57,7 +56,7 @@ use vars qw(
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
if (defined $::FORM{"GoAheadAndLogIn"}) { if ($cgi->param("GoAheadAndLogIn")) {
# We got here from a login page, probably from relogin.cgi. We better # We got here from a login page, probably from relogin.cgi. We better
# make sure the password is legit. # make sure the password is legit.
Bugzilla->login(LOGIN_REQUIRED); Bugzilla->login(LOGIN_REQUIRED);
...@@ -106,7 +105,7 @@ if ($userid) { ...@@ -106,7 +105,7 @@ if ($userid) {
} }
} }
if ($::FORM{'nukedefaultquery'}) { if ($cgi->param('nukedefaultquery')) {
if ($userid) { if ($userid) {
$dbh->do("DELETE FROM namedqueries" . $dbh->do("DELETE FROM namedqueries" .
" WHERE userid = ? AND name = ?", " WHERE userid = ? AND name = ?",
...@@ -364,32 +363,32 @@ $vars->{'fields'} = \@fields; ...@@ -364,32 +363,32 @@ $vars->{'fields'} = \@fields;
# Creating new charts - if the cmd-add value is there, we define the field # Creating new charts - if the cmd-add value is there, we define the field
# value so the code sees it and creates the chart. It will attempt to select # value so the code sees it and creates the chart. It will attempt to select
# "xyzzy" as the default, and fail. This is the correct behaviour. # "xyzzy" as the default, and fail. This is the correct behaviour.
foreach my $cmd (grep(/^cmd-/, keys(%::FORM))) { foreach my $cmd (grep(/^cmd-/, $cgi->param)) {
if ($cmd =~ /^cmd-add(\d+)-(\d+)-(\d+)$/) { if ($cmd =~ /^cmd-add(\d+)-(\d+)-(\d+)$/) {
$::FORM{"field$1-$2-$3"} = "xyzzy"; $cgi->param(-name => "field$1-$2-$3", -value => "xyzzy");
} }
} }
if (!exists $::FORM{'field0-0-0'}) { if (!$cgi->param('field0-0-0')) {
$::FORM{'field0-0-0'} = "xyzzy"; $cgi->param(-name => 'field0-0-0', -value => "xyzzy");
} }
# Create data structure of boolean chart info. It's an array of arrays of # Create data structure of boolean chart info. It's an array of arrays of
# arrays - with the inner arrays having three members - field, type and # arrays - with the inner arrays having three members - field, type and
# value. # value.
my @charts; my @charts;
for (my $chart = 0; $::FORM{"field$chart-0-0"}; $chart++) { for (my $chart = 0; $cgi->param("field$chart-0-0"); $chart++) {
my @rows; my @rows;
for (my $row = 0; $::FORM{"field$chart-$row-0"}; $row++) { for (my $row = 0; $cgi->param("field$chart-$row-0"); $row++) {
my @cols; my @cols;
for (my $col = 0; $::FORM{"field$chart-$row-$col"}; $col++) { for (my $col = 0; $cgi->param("field$chart-$row-$col"); $col++) {
push(@cols, { field => $::FORM{"field$chart-$row-$col"}, push(@cols, { field => $cgi->param("field$chart-$row-$col"),
type => $::FORM{"type$chart-$row-$col"}, type => $cgi->param("type$chart-$row-$col"),
value => $::FORM{"value$chart-$row-$col"} }); value => $cgi->param("value$chart-$row-$col") });
} }
push(@rows, \@cols); push(@rows, \@cols);
} }
push(@charts, {'rows' => \@rows, 'negate' => $::FORM{"negate$chart"}}); push(@charts, {'rows' => \@rows, 'negate' => $cgi->param("negate$chart")});
} }
$default{'charts'} = \@charts; $default{'charts'} = \@charts;
...@@ -412,13 +411,14 @@ if ($cgi->cookie('LASTORDER')) { ...@@ -412,13 +411,14 @@ if ($cgi->cookie('LASTORDER')) {
unshift(@orders, $deforder); unshift(@orders, $deforder);
} }
if ($::FORM{'order'}) { $deforder = $::FORM{'order'} } if ($cgi->param('order')) { $deforder = $cgi->param('order') }
$vars->{'userdefaultquery'} = $userdefaultquery; $vars->{'userdefaultquery'} = $userdefaultquery;
$vars->{'orders'} = \@orders; $vars->{'orders'} = \@orders;
$default{'querytype'} = $deforder || 'Importance'; $default{'querytype'} = $deforder || 'Importance';
if (($::FORM{'query_format'} || $::FORM{'format'} || "") eq "create-series") { if (($cgi->param('query_format') || $cgi->param('format') || "")
eq "create-series") {
require Bugzilla::Chart; require Bugzilla::Chart;
$vars->{'category'} = Bugzilla::Chart::getVisibleSeries(); $vars->{'category'} = Bugzilla::Chart::getVisibleSeries();
} }
...@@ -455,7 +455,7 @@ if (defined($vars->{'format'}) && IsValidQueryType($vars->{'format'})) { ...@@ -455,7 +455,7 @@ if (defined($vars->{'format'}) && IsValidQueryType($vars->{'format'})) {
# format. # format.
my $format = GetFormat("search/search", my $format = GetFormat("search/search",
$vars->{'query_format'} || $vars->{'format'}, $vars->{'query_format'} || $vars->{'format'},
$cgi->param('ctype')); scalar $cgi->param('ctype'));
print $cgi->header($format->{'ctype'}); print $cgi->header($format->{'ctype'});
......
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