Subject: | $q->delete_all only deletes one param |
Test script showing bug:
#!/usr/bin/perl
use CGI;
$q = new CGI;
$q->param('foo', 1);
$q->param('bar', 1);
warn "Before delete_all: ". join ' ', $q->param;
$q->delete_all();
warn "After delete_all: ". join ' ', $q->param;
-------------
Script output:
Show quoted text
> ./test.pl
Before delete_all: foo bar at ./test.pl line 8.
After delete_all: bar at ./test.pl line 10.
--------------
Suggested fix:
delete_all should pass a pointer to the array of parameters instead of the array itself since that's how delete seems to be expecting it.
Show quoted text> diff -u /usr/lib/perl5/5.8.0/CGI-2.93.pm /usr/lib/perl5/5.8.0/CGI.pm
--- /usr/lib/perl5/5.8.0/CGI-2.93.pm Mon May 19 19:03:31 2003
+++ /usr/lib/perl5/5.8.0/CGI.pm Mon May 19 19:02:18 2003
@@ -1052,7 +1052,7 @@
sub delete_all {
my($self) = self_or_default(@_);
my @param = $self->param;
- $self->delete(@param);
+ $self->delete( [ @param ] );
}
EOF