diff options
author | mkanat%bugzilla.org <> | 2008-06-30 04:57:54 +0200 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2008-06-30 04:57:54 +0200 |
commit | c1ca86053ed276aa05eac8468cea61785629ac5e (patch) | |
tree | 836d5cae869dc47008b16bccb1de47320a36fcc8 /votes.cgi | |
parent | 9ed763d945ffe2a468871d4731f3bd001caab21c (diff) | |
download | bugzilla-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-x | votes.cgi | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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"); |