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];
}