Subject: | query_form is not working as IE and Mozilla do |
I had a form with a field with name "month[]". While Mozilla and IE escaped the brackets with "month%5B%5D", URI/_query.pm at query_form didn't so.
This is a fix, but maybe there are more problematic characters.
--- URI/_query.pm~
+++ URI/_query.pm
@@ -30,12 +30,12 @@
my @query;
while (my($key,$vals) = splice(@_, 0, 2)) {
$key = '' unless defined $key;
- $key =~ s/([;\/?:@&=+,\$%])/$URI::Escape::escapes{$1}/g;
+ $key =~ s/([\[\];\/?:@&=+,\$%])/$URI::Escape::escapes{$1}/g;
$key =~ s/ /+/g;
$vals = [ref($vals) ? @$vals : $vals];
for my $val (@$vals) {
$val = '' unless defined $val;
- $val =~ s/([;\/?:@&=+,\$%])/$URI::Escape::escapes{$1}/g;
+ $val =~ s/([\[\];\/?:@&=+,\$%])/$URI::Escape::escapes{$1}/g;
$val =~ s/ /+/g;
push(@query, "$key=$val");
}