From c1ca86053ed276aa05eac8468cea61785629ac5e Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Mon, 30 Jun 2008 02:57:54 +0000 Subject: Bug 440612 – Use Bugzilla::Bug->check everywhere instead of ValidateBugID Patch By Max Kanat-Alexander r=LpSolit, a=LpSolit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- votes.cgi | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'votes.cgi') 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"); -- cgit v1.2.3-24-g4f1b