Closed oalders closed 4 years ago
I think this needs a change to the HTML::Form requirement for the module, too.
It looks to me like this change requires HTML::Form 6.06, no? If someone doesn't have 6.06 and they use this, Mech isn't going to work, right?
@petdance thanks for reviewing this. It won't break older versions of WWW::Mechanize
. This is just drawing attention to an incorrect use of find_input
where an index < 1 gets passed to find_input
.
HTML::Form
does fix up 0 to 1 here: https://github.com/choroba/HTML-Form/blob/0db2697f3fcdd385dc67cac4ee31fb4958093220/lib/HTML/Form.pm#L525 but that should probably be a defined check.
That sub was really confusing. It was using a 1-based list but allowing a 0 to be passed as an index value and then subtly changing that to 1 later on, so you could pass 0 or 1 and still get the same value back. :(
Since this dist is currently broken, I'm going to go ahead and merge + release.
Fixes https://github.com/libwww-perl/HTML-Form/issues/22