Skip Menu |

This queue is for tickets about the URI CPAN distribution.

Report information
The Basics
Id: 3074
Status: resolved
Priority: 0/
Queue: URI

People
Owner: Nobody in particular
Requestors:
Cc:
AdminCc:

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



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"); }
I have now applied this patch. The escaping should not strictly be needed since "[" and "]" has no special meaning in the query syntax. RFC 2396 states that: Within a query component, the characters ";", "/", "?", ":", "@", "&", "=", "+", ",", and "$" are reserved. RFC 2732 adds "[" and "]" to the reserved set but does not explictly modify the definition of query. This might be an oversight as the list above match the reserved set in RFC 2396. This change should show up in URI-1.25 when it is released.