Subject: | url() doesn't handle newlines properly when stripping query_string |
the url() function in CGI.pm doesn't handle newlines properly when stripping query_string. For example, a query_string of foo%0Abar does not get properly stripped.
The fix is simple. Just add the /s modifier to the regexp that strips the query string. Please see the attached patch.
*** /usr/lib/perl5/5.8.0/CGI.pm 2004-01-19 07:39:30.000000000 -0500
--- /tmp/CGI.pm 2004-02-15 16:43:09.000000000 -0500
***************
*** 2545,2551 ****
if (exists($ENV{REQUEST_URI})) {
my $index;
$script_name = unescape($ENV{REQUEST_URI});
! $script_name =~ s/\?.+$//; # strip query string
# and path
if (exists($ENV{PATH_INFO})) {
my $encoded_path = unescape($ENV{PATH_INFO});
--- 2545,2551 ----
if (exists($ENV{REQUEST_URI})) {
my $index;
$script_name = unescape($ENV{REQUEST_URI});
! $script_name =~ s/\?.+$//s; # strip query string
# and path
if (exists($ENV{PATH_INFO})) {
my $encoded_path = unescape($ENV{PATH_INFO});