Subject: | url(-relative=>1) must use $uri, not $script_name, if $rewrite_in_use |
This is Red Hat Bugzilla 188411:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=188441
If the URL has been rewritten (script_name != request_uri), the code
correctly uses $request_uri, unless $rewrite==0 .
But if $relative>0, then $script_name is still used.
Is this not a bug ?
I propose the attached patch (generated against 3.15 code).
Subject: | perl-5.8.8-bz188441.patch |
--- perl-5.8.8/lib/CGI.pm~ 2006-01-08 11:40:30.000000000 -0500
+++ perl-5.8.8/lib/CGI.pm 2006-04-12 18:49:26.000000000 -0400
@@ -2650,7 +2650,7 @@
return $url if $base;
$url .= $uri;
} elsif ($relative) {
- ($url) = $script_name =~ m!([^/]+)$!;
+ ($url) = $uri =~ m!([^/]+)$!;
} elsif ($absolute) {
$url = $uri;
}