_unpack_params($buf);
} elsif (index($ct, 'multipart/form-data') >= 0) {
my $p = get_unpacked_body_object_from($_[0])->param;
- # forcible arrayification
+ # forcible arrayification (functional, $p does not belong to us,
+ # do NOT replace this with a side-effect ridden "simpler" version)
+{
map +(ref($p->{$_}) eq 'ARRAY'
? ($_ => $p->{$_})
(my $params = $_[0]) =~ s/\+/ /g;
my ($name, $value);
foreach my $pair (split(/[&;](?:\s+)?/, $params)) {
- next unless (($name, $value) = split(/=/, $pair, 2)) == 2;
+ $value = 1 unless (($name, $value) = split(/=/, $pair, 2)) == 2;
s/$DECODE/$hex_chr{$1}/gs for ($name, $value);
$_ = decode_utf8 $_ for ($name, $value);