Closed Bug 238869 Opened 20 years ago Closed 20 years ago

remove %FORM from votes.cgi

Categories

(Bugzilla :: Bugzilla-General, enhancement)

2.17.7
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: justdave, Assigned: kiko)

References

Details

Attachments

(1 file)

This should be another (relatively) easy one.

47:my $action = $::FORM{'action'} || 
48:                                 ($::FORM{'bug_id'} ? "show_bug" : "show_user");
51:    ($action eq "show_user" && defined($::FORM{'user'}))) 
65:if (defined $::FORM{'bug_id'}) {
66:  ValidateBugID($::FORM{'bug_id'});
93:    my $bug_id = $::FORM{'bug_id'} 
127:    my $bug_id = $::FORM{'bug_id'} || "";
129:    my $name = $::FORM{'user'} || Bugzilla->user->login;
239:    my @buglist = grep {/^[1-9][0-9]*$/} keys(%::FORM);
244:        if (!defined($::FORM{'delete_all_votes'})) {
250:        elsif ($::FORM{'delete_all_votes'} == 0) {
263:      detaint_natural($::FORM{$id})
288:            $prodcount{$prod} += $::FORM{$id};
291:            ($::FORM{$id} <= $max)               
295:                                 votes => $::FORM{$id}});
329:        if ($::FORM{$id} > 0) {
331:                     VALUES ($who, $id, $::FORM{$id})");
Attached patch kiko_v1: fixSplinter Review
There's an XXX question there:

-    my @buglist = grep {/^[1-9][0-9]*$/} keys(%::FORM);
+    my @buglist = grep {/^[1-9][0-9]*$/} $cgi->param();

I think this does what I want and via testing it looks correct, but I'm no
expert!
Assignee: nobody → kiko
Status: NEW → ASSIGNED
Attachment #144986 - Flags: review?(justdave)
Target Milestone: --- → Bugzilla 2.18
Comment on attachment 144986 [details] [diff] [review]
kiko_v1: fix

>Index: votes.cgi
>-    my @buglist = grep {/^[1-9][0-9]*$/} keys(%::FORM);
>+
>+    # XXX is this correct?
>+    my @buglist = grep {/^[1-9][0-9]*$/} $cgi->param();

Looks correct to me...	have you tested it? :)
Severity: normal → enhancement
Yes, I did, but I wanted to make sure the code looked correct. r=justdave?
Attachment #144986 - Flags: review?
Comment on attachment 144986 [details] [diff] [review]
kiko_v1: fix

Looks good.

+
+    # XXX is this correct?
+    my @buglist = grep {/^[1-9][0-9]*$/} $cgi->param();

It looks ok to me and justdave said it's correct and you tested it and it
works, so I think you can drop the XXX comment :-)
Attachment #144986 - Flags: review? → review+
Flags: approval?
Comment on attachment 144986 [details] [diff] [review]
kiko_v1: fix

r= justdave assuming you nuke the XXX comment prior to checkin.
Attachment #144986 - Flags: review?(justdave)
Flags: approval? → approval+
/cvsroot/mozilla/webtools/bugzilla/votes.cgi,v  <--  votes.cgi
new revision: 1.17; previous revision: 1.16

One more down. Thanks!
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: