Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 19044
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: LDS [...] cpan.org
Requestors: pguerguin [...] gmail.com
philippe.simonet [...] swisscom.com
Cc:
AdminCc:

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



Subject: url(...) returns empty results with IIS
the url() function returns an empty value since i upgraded to the 3.20. the problem is probably coming by the fact the path_info and script_name contains the same string, and the _name_and_path_from_env is just blanking it. sub _name_and_path_from_env { ...... my $protected = quotemeta($raw_path_info); $raw_script_name =~ s/$protected$//; this has as side effect that the alst s// of the url function is giving a 'Use of uninitialized value in substitution (s///) at (eval...' because the $url is empty. here a extract of a print Dumper(\%ENV); 'SCRIPT_NAME' => '/sm/list.cgi', 'PATH_INFO' => '/sm/list.cgi', 'REQUEST_URI' => '/sm/list.cgi?inf_cost=1', 'QUERY_STRING' => 'inf_cost=1',
See also the following for the same problem... https://bugzilla.mozilla.org/show_bug.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&id=332555 http://guest:guest@rt.perl.org/rt3/Ticket/Display.html?id=38865 On Wed May 03 02:21:09 2006, guest wrote: Show quoted text
> the url() function returns an empty value since i upgraded to the 3.20. > > the problem is probably coming by the fact the path_info and > script_name contains the same string, and the _name_and_path_from_env > is just blanking it. > > sub _name_and_path_from_env { > ...... > my $protected = quotemeta($raw_path_info); > $raw_script_name =~ s/$protected$//; > > > this has as side effect that the alst s// of the url function is > giving a 'Use of uninitialized value in substitution (s///) at > (eval...' because the $url is empty. > > here a extract of a print Dumper(\%ENV); > > 'SCRIPT_NAME' => '/sm/list.cgi', > 'PATH_INFO' => '/sm/list.cgi', > 'REQUEST_URI' => '/sm/list.cgi?inf_cost=1', > 'QUERY_STRING' => 'inf_cost=1', >
The simplified test case from the above is... perl -MCGI -w -e'print CGI->new->url(-relative => 1)' Use of uninitialized value in substitution (s///) at (eval 4) line 44. Use of uninitialized value in print at -e line 1. On Fri May 19 16:33:38 2006, SMPETERS wrote: Show quoted text
> See also the following for the same problem... > >
https://bugzilla.mozilla.org/show_bug.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&id=332555 Show quoted text
> http://guest:guest@rt.perl.org/rt3/Ticket/Display.html?id=38865 > > On Wed May 03 02:21:09 2006, guest wrote:
> > the url() function returns an empty value since i upgraded to the
> 3.20.
> > > > the problem is probably coming by the fact the path_info and > > script_name contains the same string, and the
> _name_and_path_from_env
> > is just blanking it. > > > > sub _name_and_path_from_env { > > ...... > > my $protected = quotemeta($raw_path_info); > > $raw_script_name =~ s/$protected$//; > > > > > > this has as side effect that the alst s// of the url function is > > giving a 'Use of uninitialized value in substitution (s///) at > > (eval...' because the $url is empty. > > > > here a extract of a print Dumper(\%ENV); > > > > 'SCRIPT_NAME' => '/sm/list.cgi', > > 'PATH_INFO' => '/sm/list.cgi', > > 'REQUEST_URI' => '/sm/list.cgi?inf_cost=1', > > 'QUERY_STRING' => 'inf_cost=1', > >
> >
Subject: car insurance<a href='http://www.insurance-top.com'
From: http://www.insurance-top.com
<a href='http://www.yahoo.com'></a>Thanks! http://www.insurance-top.com/auto/ <a href='http://www.insurance-top.com'>auto insurance</a>. <a href="http://www.insurance-top.com ">Insurance car</a>: auto site insurance, car site insurance, The autos insurance company. Also [url]http://www.insurance-top.com/car/[/url] and [link=http://www.insurance-top.com]insurance quote[/link] from site .
Subject: insurance auto<a href='http://www.insurance-top.com'
From: http://www.insurance-top.com
Thanks!!! http://www.insurance-top.com/company/ auto site insurance. [URL=http://www.insurance-top.com]home insurance[/URL]: auto site insurance, car site insurance, The autos insurance company. Also [url=http://www.insurance-top.com]cars insurance[/url] from website .
Subject: insurance auto<a href='http://www.insurance-top.com'
From: http://www.insurance-top.com
Hi! http://www.insurance-top.com/company/ auto site insurance. auto site insurance, car site insurance, The autos insurance company. from website .
From: mail [...] kcaran.com
I am seeing the same thing on both IIS 5.0 and IIS 6.0. Here is my patch for the issue (CGI.pm version 3.20): 2644c2644 < --- Show quoted text
> undef $path if ($path eq $script_name);
2780,2781c2780,2783 < my $protected = quotemeta($raw_path_info); < $raw_script_name =~ s/$protected$//; --- Show quoted text
> if ($raw_path_info ne $raw_script_name) { > my $protected = quotemeta($raw_path_info); > $raw_script_name =~ s/$protected$//; > }
On Wed May 03 02:21:09 2006, guest wrote: Show quoted text
> the url() function returns an empty value since i upgraded to the 3.20. > > the problem is probably coming by the fact the path_info and > script_name contains the same string, and the _name_and_path_from_env > is just blanking it. > > sub _name_and_path_from_env { > ...... > my $protected = quotemeta($raw_path_info); > $raw_script_name =~ s/$protected$//; > > > this has as side effect that the alst s// of the url function is > giving a 'Use of uninitialized value in substitution (s///) at > (eval...' because the $url is empty. > > here a extract of a print Dumper(\%ENV); > > 'SCRIPT_NAME' => '/sm/list.cgi', > 'PATH_INFO' => '/sm/list.cgi', > 'REQUEST_URI' => '/sm/list.cgi?inf_cost=1', > 'QUERY_STRING' => 'inf_cost=1', >
Subject: RE: [rt.cpan.org #19044] url(...) returns empty results with IIS
Date: Wed, 16 Aug 2006 09:26:00 +0200
To: <bug-CGI.pm [...] rt.cpan.org>
From: <Philippe.Simonet [...] swisscom.com>
Many Thanks ! The problem that id find is that the current activestate is delivered with a buggy version of cgi.pm ... best regards Philippe Show quoted text
> -----Original Message----- > From: Keith A. Carangelo via RT [mailto:bug-CGI.pm@rt.cpan.org] > Sent: Wednesday, July 26, 2006 9:33 PM > To: Simonet Philippe, IT-SDL-SEE-CNV-SSE > Subject: [rt.cpan.org #19044] url(...) returns empty results with IIS > > > <URL: http://rt.cpan.org/Ticket/Display.html?id=19044 > > > I am seeing the same thing on both IIS 5.0 and IIS 6.0. > Here is my patch for the issue (CGI.pm version 3.20): > > 2644c2644 > < > ---
> > undef $path if ($path eq $script_name);
> 2780,2781c2780,2783 > < my $protected = quotemeta($raw_path_info); > < $raw_script_name =~ s/$protected$//; > ---
> > if ($raw_path_info ne $raw_script_name) { > > my $protected = quotemeta($raw_path_info); > > $raw_script_name =~ s/$protected$//; > > }
> > > On Wed May 03 02:21:09 2006, guest wrote:
> > the url() function returns an empty value since i upgraded
> to the 3.20.
> > > > the problem is probably coming by the fact the path_info and > > script_name contains the same string, and the
> _name_and_path_from_env
> > is just blanking it. > > > > sub _name_and_path_from_env { > > ...... > > my $protected = quotemeta($raw_path_info); > > $raw_script_name =~ s/$protected$//; > > > > > > this has as side effect that the alst s// of the url function is > > giving a 'Use of uninitialized value in substitution (s///) at > > (eval...' because the $url is empty. > > > > here a extract of a print Dumper(\%ENV); > > > > 'SCRIPT_NAME' => '/sm/list.cgi', > > 'PATH_INFO' => '/sm/list.cgi', > > 'REQUEST_URI' => '/sm/list.cgi?inf_cost=1', > > 'QUERY_STRING' => 'inf_cost=1', > >
> > > >
Subject: Re: [rt.cpan.org #19044] url(...) returns empty results with IIS
Date: Thu, 17 Aug 2006 19:14:54 -0400
To: bug-CGI.pm [...] rt.cpan.org
From: "Lincoln Stein" <lincoln.stein [...] gmail.com>
Hi Philippe, Can I close this issue or is it a problem in version 3.21 (the current one)? Lincoln On 8/16/06, philippe.simonet@swisscom.com via RT <bug-CGI.pm@rt.cpan.org> wrote: Show quoted text
> > > Queue: CGI.pm > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=19044 > > > Many Thanks ! > The problem that id find is that the current activestate is delivered > with a buggy version > of cgi.pm ... > best regards > Philippe > > > >
> > -----Original Message----- > > From: Keith A. Carangelo via RT [mailto:bug-CGI.pm@rt.cpan.org] > > Sent: Wednesday, July 26, 2006 9:33 PM > > To: Simonet Philippe, IT-SDL-SEE-CNV-SSE > > Subject: [rt.cpan.org #19044] url(...) returns empty results with IIS > > > > > > <URL: http://rt.cpan.org/Ticket/Display.html?id=19044 > > > > > I am seeing the same thing on both IIS 5.0 and IIS 6.0. > > Here is my patch for the issue (CGI.pm version 3.20): > > > > 2644c2644 > > < > > ---
> > > undef $path if ($path eq $script_name);
> > 2780,2781c2780,2783 > > < my $protected = quotemeta($raw_path_info); > > < $raw_script_name =~ s/$protected$//; > > ---
> > > if ($raw_path_info ne $raw_script_name) { > > > my $protected = quotemeta($raw_path_info); > > > $raw_script_name =~ s/$protected$//; > > > }
> > > > > > On Wed May 03 02:21:09 2006, guest wrote:
> > > the url() function returns an empty value since i upgraded
> > to the 3.20.
> > > > > > the problem is probably coming by the fact the path_info and > > > script_name contains the same string, and the
> > _name_and_path_from_env
> > > is just blanking it. > > > > > > sub _name_and_path_from_env { > > > ...... > > > my $protected = quotemeta($raw_path_info); > > > $raw_script_name =~ s/$protected$//; > > > > > > > > > this has as side effect that the alst s// of the url function is > > > giving a 'Use of uninitialized value in substitution (s///) at > > > (eval...' because the $url is empty. > > > > > > here a extract of a print Dumper(\%ENV); > > > > > > 'SCRIPT_NAME' => '/sm/list.cgi', > > > 'PATH_INFO' => '/sm/list.cgi', > > > 'REQUEST_URI' => '/sm/list.cgi?inf_cost=1', > > > 'QUERY_STRING' => 'inf_cost=1', > > >
> > > > > > > >
> >
-- Lincoln D. Stein Cold Spring Harbor Laboratory 1 Bungtown Road Cold Spring Harbor, NY 11724 (516) 367-8380 (voice) (516) 367-8389 (fax) FOR URGENT MESSAGES & SCHEDULING, PLEASE CONTACT MY ASSISTANT, SANDRA MICHELSEN, AT michelse@cshl.edu
Subject: RE: [rt.cpan.org #19044] url(...) returns empty results with IIS
Date: Mon, 21 Aug 2006 09:57:47 +0200
To: <bug-CGI.pm [...] rt.cpan.org>
From: <Philippe.Simonet [...] swisscom.com>
whre can I find the version 3.21 to test it ? Show quoted text
> -----Original Message----- > From: Lincoln Stein via RT [mailto:bug-CGI.pm@rt.cpan.org] > Sent: Friday, August 18, 2006 1:15 AM > To: Simonet Philippe, IT-SDL-SEE-CNV-SSE > Subject: Re: [rt.cpan.org #19044] url(...) returns empty > results with IIS > > > <URL: http://rt.cpan.org/Ticket/Display.html?id=19044 > > > Hi Philippe, > > Can I close this issue or is it a problem in version 3.21 > (the current one)? > > Lincoln >
Problem seems to be fixed in 3.21.
Subject: still problems with url() and IIS see # 19044
Date: Fri, 22 Sep 2006 06:35:00 +0200
To: bug-CGI.pm [...] rt.cpan.org
From: "Philippe Guerguin" <pguerguin [...] gmail.com>
Hi ! I think that problems with method url() are not solved in CGI.pm 3.23 with MS IIS see ticket # 19044 Actual url http://localhost:80/cgi-bin/cgitest.pl?arg1=1&arg2=2 Server Software Microsoft-IIS/5.1 CGI Version 3.23 self_url() http://localhost/cgi-bin/cgitest.pl?arg1=1;arg2=2 url() http://localhost url(full=>1) -> EMPTY url(relative=>1) -> EMPTY url(-absolute=>1) -> EMPTY url(-path=>1) http://localhost/cgi-bin/cgitest.pl url(-path_info=>1) http://localhost/cgi-bin/cgitest.pl url(-query=>1) -> WRONG : http://localhost?arg1=1;arg2=2 url(-query_string=>1) -> WRONG : http://localhost?arg1=1;arg2=2 url(-path=>1,-query=>1) http://localhost/cgi-bin/cgitest.pl?arg1=1;arg2=2 url(base=>1) -> EMPTY Everything is fine if I use Apache instead of IIS. When installing ActivePerl 5.8.8.817 it comes with 3.15 which shows the problem, while 3.10 coming with ActivePerl 5.8.7 is correct. Thanks for your help Regards
Subject: Re: [rt.cpan.org #19044] url(...) returns empty results with IIS
Date: Thu, 17 May 2007 16:39:14 -0700
To: <bug-CGI.pm [...] rt.cpan.org>
From: "Michael Kincaid" <michael [...] luidia.com>
I'm still seeing this problem in CGI.pm 3.29, with IIS 5.1 in Win XP SP2. Here's a patch that seems to fix it: *** CGI.pm 2006-04-23 08:25:14.000000000 -0700 --- CGI-fixed.pm 2007-05-17 16:18:37.843750000 -0700 *************** *** 2667,2672 **** --- 2667,2673 ---- $url = $uri; } + $url ||= ''; $url .= $path if $path_info and defined $path; $url .= "?$query_str" if $query and $query_str ne ''; $url =~ s/([^a-zA-Z0-9_.%;&?\/\\:+=~-])/sprintf("%%%02X",ord($1))/eg;
From: michael [...] luidia.com
I'm still seeing this problem in CGI.pm 3.29, with IIS 5.1 in Win XP SP2. Here's a patch that seems to fix it: *** CGI.pm 2006-04-23 08:25:14.000000000 -0700 --- CGI-fixed.pm 2007-05-17 16:18:37.843750000 -0700 *************** *** 2667,2672 **** --- 2667,2673 ---- $url = $uri; } + $url ||= ''; $url .= $path if $path_info and defined $path; $url .= "?$query_str" if $query and $query_str ne ''; $url =~ s/([^a-zA-Z0-9_.%;&?\/\\:+=~-])/sprintf("%%%02X",ord($1))/eg;
Given the lack of comments on this since 2007, I'm going to mark it as "resolved" with no further action. If there's still a problem with 3.63, please re-open the ticket. Mark