RSS

(root)/bugzilla/3.6 : 6113 : votes.cgi

To get this branch, use:
bzr branch /bugzilla/3.6

« back to all changes in this revision

Viewing changes to votes.cgi

mkanat%bugzilla.org
2008-06-29 19:57:54
Revision ID: cvs-1:mkanatbugzilla.org-20080630025754-h0rylmikmb6z28g1
Bug 440612 â€“ Use Bugzilla::Bug->check everywhere instead of ValidateBugID
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit

Show diffs side-by-side

added added

removed removed

67
67
# Make sure the bug ID is a positive integer representing an existing
68
68
# bug that the user is authorized to access.
69
69
 
70
 
ValidateBugID($bug_id) if defined $bug_id;
 
70
if (defined $bug_id) {
 
71
    my $bug = Bugzilla::Bug->check($bug_id);
 
72
    $bug_id = $bug->id;
 
73
}
71
74
 
72
75
################################################################################
73
76
# End Data/Security Validation
244
247
        }
245
248
    }
246
249
 
247
 
    # Call ValidateBugID on each bug ID to make sure it is a positive
 
250
    # Call check() on each bug ID to make sure it is a positive
248
251
    # integer representing an existing bug that the user is authorized 
249
252
    # to access, and make sure the number of votes submitted is also
250
253
    # a non-negative integer (a series of digits not preceded by a
251
254
    # minus sign).
252
255
    my %votes;
253
256
    foreach my $id (@buglist) {
254
 
      ValidateBugID($id);
 
257
      my $bug = Bugzilla::Bug->check($id);
 
258
      $id = $bug->id;
255
259
      $votes{$id} = $cgi->param($id);
256
260
      detaint_natural($votes{$id}) 
257
261
        || ThrowUserError("votes_must_be_nonnegative");

Loggerhead 1.18.1 is a web-based interface for Bazaar branches