summaryrefslogtreecommitdiffstats
path: root/process_bug.cgi
diff options
context:
space:
mode:
authormkanat%kerio.com <>2006-03-03 08:50:13 +0100
committermkanat%kerio.com <>2006-03-03 08:50:13 +0100
commit6c16eddbad9bcef7d7b2d51dc274451a152524fe (patch)
tree7a153e2f238420fc777d5f7d13cad910f5f54742 /process_bug.cgi
parent975b2688b862a89f302a77b9a42c8f794fed13a8 (diff)
downloadbugzilla-6c16eddbad9bcef7d7b2d51dc274451a152524fe.tar.gz
bugzilla-6c16eddbad9bcef7d7b2d51dc274451a152524fe.tar.xz
Bug 328602: Eliminate %::versions and @::legal_versions
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=myk
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi12
1 files changed, 7 insertions, 5 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index d37ec5231..0e5ec9427 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -56,6 +56,7 @@ use Bugzilla::BugMail;
use Bugzilla::User;
use Bugzilla::Util;
use Bugzilla::Field;
+use Bugzilla::Product;
# Use the Flag module to modify flag data if the user set flags.
use Bugzilla::Flag;
@@ -64,7 +65,6 @@ use Bugzilla::FlagType;
# Shut up misguided -w warnings about "used only once":
use vars qw(@legal_product
- %versions
%components
%legal_opsys
%legal_platform
@@ -308,6 +308,7 @@ if (((defined $cgi->param('id') && $cgi->param('product') ne $oldproduct)
}
my $prod = $cgi->param('product');
+ my $prod_obj = new Bugzilla::Product({name => $prod});
trick_taint($prod);
# If at least one bug does not belong to the product we are
@@ -335,7 +336,8 @@ if (((defined $cgi->param('id') && $cgi->param('product') ne $oldproduct)
# pretty weird case, and not terribly unreasonable behavior, but
# worthy of a comment, perhaps.
#
- my $vok = lsearch($::versions{$prod}, $cgi->param('version')) >= 0;
+ my @version_names = map($_->name, @{$prod_obj->versions});
+ my $vok = lsearch(\@version_names, $cgi->param('version')) >= 0;
my $cok = lsearch($::components{$prod}, $cgi->param('component')) >= 0;
my $mok = 1; # so it won't affect the 'if' statement if milestones aren't used
@@ -359,7 +361,7 @@ if (((defined $cgi->param('id') && $cgi->param('product') ne $oldproduct)
# We set the defaults to these fields to the old value,
# if its a valid option, otherwise we use the default where
# that's appropriate
- $vars->{'versions'} = $::versions{$prod};
+ $vars->{'versions'} = \@version_names;
if ($vok) {
$defaults{'version'} = $cgi->param('version');
}
@@ -612,11 +614,11 @@ if (defined $cgi->param('id')) {
# values that have been changed instead of submitting all the new values.
# (XXX those error checks need to happen too, but implementing them
# is more work in the current architecture of this script...)
- check_field('product', scalar $cgi->param('product'), \@::legal_product);
+ my $prod_obj = Bugzilla::Product::check_product($cgi->param('product'));
check_field('component', scalar $cgi->param('component'),
\@{$::components{$cgi->param('product')}});
check_field('version', scalar $cgi->param('version'),
- \@{$::versions{$cgi->param('product')}});
+ [map($_->name, @{$prod_obj->versions})]);
if ( Param("usetargetmilestone") ) {
check_field('target_milestone', scalar $cgi->param('target_milestone'),
\@{$::target_milestone{$cgi->param('product')}});