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: 89353
Status: rejected
Priority: 0/
Queue: CGI

People
Owner: Nobody in particular
Requestors: joerg [...] port25.com
Cc:
AdminCc:

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



Subject: Using -attributes and -disabled with a checkbox_group generates invalid HTML
Date: Tue, 08 Oct 2013 20:53:24 +0000
To: bug-CGI.pm [...] rt.cpan.org
From: Jörg Westheide <joerg [...] port25.com>
I found the following code to generate invalid HTML: #!/usr/bin/perl -w use strict; use CGI; my $q = CGI->new(); print $q->checkbox_group(-name => 'box', -values => 'a', -disabled => ["a"], -attributes => {"a" => {"foo" => "bar"}}); The generated output is: <label><input type="checkbox" name="box" value="a" foo="bar"disabled='1'/><span style="color:gray">a</span></label> Note the missing white space between foo="bar" and disabled='1'. The bug is reproducible with CGI.pm versions 3.42 and 3.63, presumably all versions in between and possibly older ones, too. Here's a diff of a possible fix of v3.63: --- CGI.pm 2012-11-15 00:42:54.000000000 +0100 +++ CGI.pm 2013-10-08 17:31:02.000000000 +0200 @@ -2476,7 +2476,7 @@ for (@values) { my $disable=""; if ($disabled{$_}) { - $disable="disabled='1'"; + $disable=" disabled='1'"; } my $checkit = $self->_checked($box_type eq 'radio' ? ($checked{$_} && !$radio_checked++) Jörg
This issue has been copied to: https://github.com/leejo/CGI.pm/issues/123 please take all future correspondence there. This ticket will remain open but please do not reply here. This ticket will be closed when the github issue is dealt with.
Rejecting. I'm not accepting any feature requests, patches, or updates to the HTML generating functions of CGI.pm unless they are of a critical nature (i.e. fixing fundamentally broken HTML output).