Skip Menu |

This queue is for tickets about the CGI-ArgChecker CPAN distribution.

Report information
The Basics
Id: 4249
Status: new
Priority: 0/
Queue: CGI-ArgChecker

People
Owner: Nobody in particular
Requestors: vendra [...] sci.univr.it
Cc:
AdminCc:

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



Subject: Cannot manage multi-valued parameters
Module Distribution: CGI::ArgChecker, ver. 0.02 Perl Version: 5.6.1 O.S.: RH 7.3 - 2.4.18-5SMP Description: since the 'param' method of the query object is called in a scalar context only the first value of a multi-valued parameter is fetched and passed to the 'stringchecker'. Other values are discarded (=bug). Besides the 'stringchecker' accepts only scalar 'stringRef' so would be impossible to check direclty the list of values. Indeed the fix has to be thought on the ArgChecker side which must take care of explicitly pass all values to the 'stringchecker' and collect the results before returnig the final hash. Show quoted text
---------------- Example -------------------- my $q = new CGI({'key'=>['val1','val2','val3']}); # init query object my @values = $q -> param('key'); # returns the list of values = OK my $cgi_pars = $checker->argcheck ($q, 'key' => ['disallow_empty']); my @values = $cgi_pars->{'key'} unless $cgi_pars->{'ERROR'}; #returns only the first value = WRONG --------------------------------------------- I think that this should at least underlined in the docs, but the usefulness of the module is fairly reduced. Walter Vendraminetto