Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WWW-Mechanize CPAN distribution.

Report information
The Basics
Id: 43341
Status: resolved
Priority: 0/
Queue: WWW-Mechanize

People
Owner: Nobody in particular
Requestors: perl [...] events.soundwave.net
Cc:
AdminCc:

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

Attachments


Subject: HTML::Form - work around checked="" and selected="" [patch]
Download (untitled) / with headers
text/plain 428b
One application I'm using WWW::Mechanize against sends out form elements like the following: <option ... SELECTED="" /> <input type="checkbox" ... CHECKED="" /> HTML::Form parses those as being not selected and not checked, which is not what the application intended. (The application may very well be wrong, but it works on popular browsers..) This patch makes HTML::Form parse those the same way as the popular browsers.
Subject: html-form-accept-empty-selected-checked.diff
--- HTML/Form.pm.orig 2009-02-16 18:27:02.000000000 -0800 +++ HTML/Form.pm 2009-02-16 18:27:07.000000000 -0800 @@ -1057,7 +1057,7 @@ { value => undef, name => "off", }, { value => $value, name => $value_name, }, ]; - $self->{current} = (delete $self->{checked}) ? 1 : 0; + $self->{current} = (defined delete $self->{checked}) ? 1 : 0; ; } else { @@ -1066,7 +1066,7 @@ $self->{menu} = [ {value => $value, name => $value_name}, ]; - my $checked = $self->{checked} || $self->{option_selected}; + my $checked = defined $self->{checked} || defined $self->{option_selected}; delete $self->{checked}; delete $self->{option_selected}; if (exists $self->{multiple}) {
migrated queue: libwww-perl -> WWW-Mechanize


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.