develooper Front page | perl.libwww | Postings from October 2011

HTML::Form bug

Thread Next
From:
Rob Dixon
Date:
October 14, 2011 15:03
Subject:
HTML::Form bug
Message ID:
4E98B1B6.5030903@gmx.com
Hi all

I sent this to Gisle on 4 October but have had no reply. Thinking his
account may be whitelisted, I am posting it again here.


Since there are no bugs - even cleared ones - on the CPAN reporting
system for this module, I suspect it is best to mail you this bug report.

Method HTML::Form::FileInput::form_name_value has been changed so that
there is now a separate 'filename' field in the object. There is also
code, marked as legacy, handling the old way of doing things.
Unfortunately is is broken, and the problem has arisen from a query
regarding WWW::Mechanize which still uses this old method.

At the start, $filename is copied from the {filename} field of the
object, or from {value} if that field is empty. Later on in the legacy
code, line 1509, $fn is copied to $filename only if it is currently
undefined. Because the 'filename' method has defaulted it to the same
value as $file it will never be undefined at this point, and can be an
array reference if the old call method is used, giving actual an actual
value in the HTTP::Request of something like "ARRAY(0x9567570)".

All that seems to be necessary to fix the problem is to remove the line

   $old = $self->file unless defined $old;

from the 'filename' method.

Cheers,

Rob Dixon




Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About