aboutsummaryrefslogtreecommitdiffstats
path: root/enter_bug.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-08-27 02:39:37 +0000
committerlpsolit%gmail.com <>2005-08-27 02:39:37 +0000
commit25c00ad223d24c8d56ed75c8b1408d8a81189eff (patch)
tree78d248bf5e3cd49d618e04b02bfa5bb8020869b6 /enter_bug.cgi
parent256ddf6ea4efc587249ddfee13e0a05a028351a7 (diff)
downloadbugs-25c00ad223d24c8d56ed75c8b1408d8a81189eff.tar
bugs-25c00ad223d24c8d56ed75c8b1408d8a81189eff.tar.gz
bugs-25c00ad223d24c8d56ed75c8b1408d8a81189eff.tar.bz2
bugs-25c00ad223d24c8d56ed75c8b1408d8a81189eff.tar.xz
bugs-25c00ad223d24c8d56ed75c8b1408d8a81189eff.zip
Bug 303694: Eliminate deprecated Bugzilla::DB routines from enter_bug.cgi - Patch by Teemu Mannermaa <wicked@etlicon.fi> r=LpSolit a=justdave
Diffstat (limited to 'enter_bug.cgi')
-rwxr-xr-xenter_bug.cgi33
1 files changed, 19 insertions, 14 deletions
diff --git a/enter_bug.cgi b/enter_bug.cgi
index fd009e518..4a32a32e7 100755
--- a/enter_bug.cgi
+++ b/enter_bug.cgi
@@ -475,15 +475,18 @@ if ( ($cloned_bug_id) &&
$default{'version'} = $vars->{'version'}->[$#{$vars->{'version'}}];
}
+# Only used with placeholders below
+trick_taint($product);
+
# Get list of milestones.
if ( Param('usetargetmilestone') ) {
$vars->{'target_milestone'} = $::target_milestone{$product};
if (formvalue('target_milestone')) {
$default{'target_milestone'} = formvalue('target_milestone');
} else {
- SendSQL("SELECT defaultmilestone FROM products WHERE " .
- "name = " . SqlQuote($product));
- $default{'target_milestone'} = FetchOneColumn();
+ $default{'target_milestone'} =
+ $dbh->selectrow_array('SELECT defaultmilestone FROM products
+ WHERE name = ?', undef, $product);
}
}
@@ -498,9 +501,9 @@ my @status;
# confirmation, user cannot confirm UNCONFIRMED
# confirmation, user can confirm NEW, UNCONFIRMED.
-SendSQL("SELECT votestoconfirm FROM products WHERE name = " .
- SqlQuote($product));
-if (FetchOneColumn()) {
+my $votestoconfirm = $dbh->selectrow_array('SELECT votestoconfirm FROM products
+ WHERE name = ?', undef, $product);
+if ($votestoconfirm) {
if (UserInGroup("editbugs") || UserInGroup("canconfirm")) {
push(@status, "NEW");
}
@@ -520,17 +523,19 @@ if (formvalue('bug_status') && (lsearch(\@status, formvalue('bug_status')) >= 0)
$default{'bug_status'} = $status[0];
}
-SendSQL("SELECT DISTINCT groups.id, groups.name, groups.description, " .
- "membercontrol, othercontrol " .
- "FROM groups LEFT JOIN group_control_map " .
- "ON group_id = id AND product_id = $product_id " .
- "WHERE isbuggroup != 0 AND isactive != 0 ORDER BY description");
+my $grouplist = $dbh->selectall_arrayref(
+ q{SELECT DISTINCT groups.id, groups.name, groups.description,
+ membercontrol, othercontrol
+ FROM groups
+ LEFT JOIN group_control_map
+ ON group_id = id AND product_id = ?
+ WHERE isbuggroup != 0 AND isactive != 0
+ ORDER BY description}, undef, $product_id);
my @groups;
-while (MoreSQLData()) {
- my ($id, $groupname, $description, $membercontrol, $othercontrol)
- = FetchSQLData();
+foreach my $row (@$grouplist) {
+ my ($id, $groupname, $description, $membercontrol, $othercontrol) = @$row;
# Only include groups if the entering user will have an option.
next if ((!$membercontrol)
|| ($membercontrol == CONTROLMAPNA)