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

People
Owner: MARKSTOS [...] cpan.org
Requestors: rlucas [...] tercent.com
Cc:
AdminCc:

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



Subject: empty name/value, when saved, prevents proper restore from filehandle.
Download (untitled) / with headers
text/plain 486b
The "save to filehandle" and "retrieve from filehandle" functions sometimes don't do a round-trip properly, if there exists in a submitted form page: <input type="radio" name="" value="" checked /> This causes a single line with only an equals on it (the empty string for both name and value). When CGI reads this in, it does a last LOOP on the regex matching /^=/. Either change the last LOOP to a next LOOP or filter out blank named items from the save to filehandle functionality
Download (untitled) / with headers
text/plain 838b
On Wed Jun 08 19:11:12 2005, guest wrote: Show quoted text
> The "save to filehandle" and "retrieve from filehandle" functions > sometimes don't do a round-trip properly, if there exists in a > submitted form page: > > <input type="radio" name="" value="" checked /> > > This causes a single line with only an equals on it (the empty string > for both name and value). When CGI reads this in, it does a last LOOP > on the regex matching /^=/. > > Either change the last LOOP to a next LOOP or filter out blank named > items from the save to filehandle functionality
Thanks for the report. From looking at 3.43, it looks like the issue might still exist, because this line is still there: last if /^=/; Would you be willing to submit an automated test case which illustrates triggering this issue, as well as your proposed fix for it? Mark
Download (untitled) / with headers
text/plain 537b
Given that the documentation of the save() method mentions that it uses a lone '=' as a session separator, I recommend skipping blank param-value pairs in save(). Such a param is of little value anyway, IMHO. Note that the BoulderIO documentation doesn't say anything about unnamed parameters, so I assume that a query string such as "=foo;=bar" should be preserved. This implies that the "last" condition should change to /^=$/. See http://github.com/rhesa/CGI.pm/commit/d22626ab9eb2fb7a82b43ac26cf49fe022d9b147 for the fix (+tests).
Download (untitled) / with headers
text/plain 105b
Thanks, Rhesa. Your patch has now been reviewed and accepted and published to my github repo. Mark
Subject: Thanks, released
Download (untitled) / with headers
text/plain 160b
The patch for this ticket has now been released in CGI.pm 3.47, and this ticket is considered resolved. Thanks again for you help to improve CGI.pm! Mark


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.