summaryrefslogtreecommitdiffstats
path: root/votes.cgi
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-06-30 04:57:54 +0200
committermkanat%bugzilla.org <>2008-06-30 04:57:54 +0200
commitc1ca86053ed276aa05eac8468cea61785629ac5e (patch)
tree836d5cae869dc47008b16bccb1de47320a36fcc8 /votes.cgi
parent9ed763d945ffe2a468871d4731f3bd001caab21c (diff)
downloadbugzilla-c1ca86053ed276aa05eac8468cea61785629ac5e.tar.gz
bugzilla-c1ca86053ed276aa05eac8468cea61785629ac5e.tar.xz
Bug 440612 – Use Bugzilla::Bug->check everywhere instead of ValidateBugID
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'votes.cgi')
-rwxr-xr-xvotes.cgi10
1 files changed, 7 insertions, 3 deletions
diff --git a/votes.cgi b/votes.cgi
index 961db7aa5..af41af0e4 100755
--- a/votes.cgi
+++ b/votes.cgi
@@ -67,7 +67,10 @@ else {
# Make sure the bug ID is a positive integer representing an existing
# bug that the user is authorized to access.
-ValidateBugID($bug_id) if defined $bug_id;
+if (defined $bug_id) {
+ my $bug = Bugzilla::Bug->check($bug_id);
+ $bug_id = $bug->id;
+}
################################################################################
# End Data/Security Validation
@@ -244,14 +247,15 @@ sub record_votes {
}
}
- # Call ValidateBugID on each bug ID to make sure it is a positive
+ # Call check() on each bug ID to make sure it is a positive
# integer representing an existing bug that the user is authorized
# to access, and make sure the number of votes submitted is also
# a non-negative integer (a series of digits not preceded by a
# minus sign).
my %votes;
foreach my $id (@buglist) {
- ValidateBugID($id);
+ my $bug = Bugzilla::Bug->check($id);
+ $id = $bug->id;
$votes{$id} = $cgi->param($id);
detaint_natural($votes{$id})
|| ThrowUserError("votes_must_be_nonnegative");