Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 20422
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: LDS [...] cpan.org
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: $cgi->param("name", undef, "param") now silently throws away values.
Previous to 3.18 this test would pass. $cgi->param("name", undef, "param"); is_deeply [$cgi->param("name")], ["param"]; Now it returns an empty list. The current behavior is dangerous as having an undefined value in your parameter list will result in the whole list being *silently* thrown away. Either it should revert to the previous behavior [preferred] or warn. I believe this is a side-effect of this change: "Fixed param() so that param(-name=>'foo',-values=>[]) sets the parameter to empty list." It is caused by the change from this code in param(): # If values is provided, then we set it. if (@values) { $self->add_parameter($name); $self->{$name}=[@values]; } to this: # If values is provided, then we set it. if (defined $value) { $self->add_parameter($name); $self->{$name}=[@values]; }
Fixed in version 3.21.