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: 58377
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: MARKSTOS [...] cpan.org
Requestors: davew [...] wsieurope.com
Cc:
AdminCc:

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



Weaver, Dave <davew@wsieurope.com> Hello, I found what appears to be a bug in CGI.pm url() returns an incorrect url if there is a “+” in PATH_INFO e.g: correct: http://example.com/cgi/urltest/hello/world gives url = http://example.com/cgi/urltest, path_info = /hello/world wrong: http://example.com/cgi/urltest/hello+world gives url = http://example.com/cgi/urltest/hello%20world , path_info = /hello+world CGI.pm v3.49 Perl: v5.8.8 O/S: CentOS 5.4 Apache, unknown version (whatever ships with CentOS 5.4) Same results using IE8, Chromium 6.0.4, and Firefox 3.5.9 Script used to generate above results: #!/usr/bin/perl use strict; use warnings; use CGI qw(:standard); print "Content-type: text/plain\n\n"; print "URL: [" . url() . "]\n"; print "PATH_INFO: [" . path_info() . "]\n"; -- Dave Weaver Weather Services International
Today I added some test coverage for this to t/url.t. The tests passed against 3.63, so it appears that if there was actually an issue here, it has been resolved. If you are still experiencing an issue with the latest release, please submit further failing tests for t/url.t which illustrate it. subtest 'RT#58377: + in PATH_INFO' => sub { local $ENV{PATH_INFO} = '/hello+world'; local $ENV{HTTP_X_FORWARDED_HOST} = undef; local $ENV{'HTTP_HOST'} = 'example.com'; local $ENV{'SCRIPT_NAME'} = '/script/plus+name.cgi'; local $ENV{'SCRIPT_FILENAME'} = '/script/plus+filename.cgi'; my $q = CGI->new; is($q->url(), 'http://example.com/script/plus+name.cgi', 'a plus sign in a script name is preserved when calling url()'); is($q->path_info(), '/hello+world', 'a plus sign in a script name is preserved when calling path_info()'); };