Subject: | query_string includes POSTDATA when recreating the query string |
If you receive a POST that is not URL encoded or a multipart form and then call query_string().
It will create a query string containing:
POSTDATA=...
Weak sauce.
It is my opinion that the query_string ought to be generated using url_param() rather than
param() or at least a notice be stated in the documentation that query_string() might do
strange things on anything other than a GET.
The workaround is something like:
my @pairs;
for my $key ($q->url_param) {
my @values = $q->url_param($key);
push @pairs, join '=', uri_escape($key), uri_escape($_) for @values;
}
my $query_string = join ';', @pairs; # or '&' if you prefer
Or something similar using URI->new->query_form.