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

People
Owner: MARKSTOS [...] cpan.org
Requestors: david [...] dierauer.net
Cc:
AdminCc:

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



Subject: hidden values output fails for lists of more than two items
Observed in using CGI 3.20 for Perl 5.8.8 on Mac OS X 10.4 (Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=darwin, osvers=8.6.1, archname=darwin-thread-multi-2level). Also observed using CGI 3.05 for Perl 5.8.5 on Redhat Linux (Summary of my perl5 (revision 5 version 8 subversion 5) configuration: Platform: osname=linux, osvers=2.4.21-4.elsmp, archname=i386-linux-thread-multi). Production of input type hidden form elements adds junk after 'value="whatever"' when list of more than 2 items is passed as second param to $cgi->hidden. The output of this code illustrates the issue: #!perl use CGI; my $cgi = CGI->new(); my @list = qw( foo bar baz fie ); print $cgi->hidden( 'sample', @list ); __END__ I get this output: <input type="hidden" name="sample" value="foo" baz fie /><input type="hidden" name="sample" value="bar" baz fie /><input type="hidden" name="sample" value="baz" baz fie /><input type="hidden" name="sample" value="fie" baz fie />
On Wed Jul 12 14:53:56 2006, guest wrote: Show quoted text
> Observed in using CGI 3.20 for Perl 5.8.8 on Mac OS X 10.4 (Summary of > my perl5 (revision 5 > version 8 subversion 8) configuration: > Platform: > osname=darwin, osvers=8.6.1, archname=darwin-thread-multi-2level). > > Also observed using CGI 3.05 for Perl 5.8.5 on Redhat Linux (Summary > of my perl5 (revision > 5 version 8 subversion 5) configuration: > Platform: > osname=linux, osvers=2.4.21-4.elsmp, archname=i386-linux-thread- > multi). > > Production of input type hidden form elements adds junk after > 'value="whatever"' when list > of more than 2 items is passed as second param to $cgi->hidden. > > The output of this code illustrates the issue: > > #!perl > use CGI; > my $cgi = CGI->new(); > > my @list = qw( > foo > bar > baz > fie > ); > print $cgi->hidden( 'sample', @list ); > __END__ > > I get this output: > <input type="hidden" name="sample" value="foo" baz fie /><input > type="hidden" > name="sample" value="bar" baz fie /><input type="hidden" name="sample" > value="baz" > baz fie /><input type="hidden" name="sample" value="fie" baz fie />
I agree this is a bug, and it is still present in CGI 3.43. Mark
There is now a patch for this here which I'll get to reviewing and integrating: http://github.com/veryrusty/CGI.pm/commit/7e40de1d64e237c00a11f085ee474c269e44e7b4 A second peer review would be welcome. Mark
Thanks for the report and patch. The patch has been applied in my github repo now and should appear in the next release, with credit to you. Mark
Subject: Thanks, released
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