Subject: | url() method doesn't complete remove query string from REQUEST_URI |
If REQUEST_URI consists %0A ( escaped new line ), then method
url(-absolute => 1, -path_info => 1) return invalide result.
url_complete_clear_req.t - test script
url_complete_clear_req.patch - patch
Subject: | url_complete_clear_req.t |
#!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 1;
use CGI;
$ENV{'REQUEST_URI'} = q!/CP/mod_user_distrjs/Set_template?form=edit_tmpl&code=1%0A&par2=1!;
my $cgi = new CGI::;
is( $cgi->url( -absolute => 1, -path_info => 1 ), '/CP/mod_user_distrjs/Set_template', "Complete remove query string")
Subject: | url_complete_clear_req.patch |
--- /usr/local/lib/perl5/site_perl/5.8.8/CGI.pm Sat Feb 24 02:03:16 2007
+++ CGI.pm Thu Mar 29 16:06:14 2007
@@ -2701,7 +2700,7 @@
undef $path if $rewrite_in_use && $rewrite; # path not valid when rewriting active
my $uri = $rewrite && $request_uri ? $request_uri : $script_name;
- $uri =~ s/\?.*$//; # remove query string
+ $uri =~ s/\?.*$//s; # remove query string
$uri =~ s/\Q$path\E$// if defined $path; # remove path
if ($full) {