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: 3048
Status: resolved
Priority: 0/
Queue: WWW-Mechanize

People
Owner: MARKSTOS [...] cpan.org
Requestors: roland [...] moriz.de
Cc:
AdminCc:

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



Subject: Problems with field names containing []
From: Roland Moriz <roland [...] moriz.de>
To: bug-WWW-Mechanize [...] rt.cpan.org
Date: 27 Jul 2003 12:10:58 +0200
Hi, looks like WWW::Mechanize has some problems with field names like "ObjeRegS0[]": Can't call method "value" on an undefined value at /usr/local/share/perl/5.8.0/WWW/Mechanize.pm line 448. which is between the ARRAY part of set_fields: while( my ( $field, $value ) = each %fields ) { if ( ref $value eq 'ARRAY' ) { $form->find_input( $field, undef, $value->[1])->value($value->[0] ); } else { $form->value($field => $value); } } also field() is affected. Probably field names with {} will fail, too. Especially poor php driven sites are using the [] syntax to get back complete arrays. with kind regards, Mit freundlichen Gruessen, Roland Moriz -- Muenchen/Germany - http://www.roland-moriz.de/
[roland@moriz.de - Sun Jul 27 06:11:06 2003]: Show quoted text
> looks like WWW::Mechanize has some problems with field names like > "ObjeRegS0[]":
Could you give an URL that works OK with Mozilla and IE, but fails with WWW::Mechanize, so I can better track the problem?
[guest - Sun Jul 27 09:19:43 2003]: Show quoted text
> [roland@moriz.de - Sun Jul 27 06:11:06 2003]:
> > looks like WWW::Mechanize has some problems with field names like > > "ObjeRegS0[]":
> Could you give an URL that works OK with Mozilla and IE, but fails
with Show quoted text
> WWW::Mechanize, so I can better track the problem?
try http://immocenter.sueddeutsche.de/index.php/3e6d818fzRGkCurc.g.BWBTV/index.php?action=immo/suchen/detail (german website) i'll extract the form now and upload it somewhere to have a better debugging possibility. regards, Roland
http://immocenter.sueddeutsche.de/index.php/3e6d818fzRGkCurc.g.BWBTV/index.php?action=immo/suchen/detail Show quoted text
> > (german website) > > i'll extract the form now and upload it somewhere to have a better > debugging possibility.
"static" version of this horrible php/javascript mess is available at: http://www.codernaut.org/form.html
Show quoted text
This is too much for me. You'll have to make a simple test case that fails with WWW::Mechanize, If you want me to look at it.
[guest - Sun Jul 27 15:57:58 2003]: Show quoted text
> This is too much for me. You'll have to make a simple test case that > fails with WWW::Mechanize, If you want me to look at it.
okay, HTML: http://www.codernaut.org/easyform.html my failing script: http://www.codernaut.org/mechanize.txt
Good job Roland! I've found something! Both IE and Mozilla send: ObjeRegS0%5B%5D=0 but WWW::Mechanize sends: ObjeRegS0[]=0 So this brackets must be quoted in the HTTP POST. Andy, do you know how to fix this problem or should I continue looking for a fix?
I have added a bug report at: http://rt.cpan.org/NoAuth/Bug.html?id=3074 It's a quick fix. So, maybe there are more problematic characters. We should find the proc that Mozilla uses to escape and do the same thing in URI/_query.pm
Gisle Aas <gisle@ActiveState.com> said he's gonna patch URI to act like MSIE/Mozilla as reported here: http://rt.cpan.org/NoAuth/Bug.html?id=3074 There's nothing more I can found related to this bug. The only problem that I've found with the related form is the use of a multiple input, that I don't know how to select options.
If this was really fixed in URI, then let's nail down the version and make that a requirement in Makefile.PL.