On Fri, 10 Sep 2004 11:44:10 +0200, Sebastian Riedel wrote
> Simon Flack:
>
> >On Fri, 10 Sep 2004 01:31:15 +0200, Sebastian Riedel wrote
> >>Simon Flack schrieb:
> >>>I just noticed that CGI::Maypole is populating $r->{params} and $r->{query}
> >>>with CGI->Vars.
> >>>
> >>>The behaviour differs from Apache::MVC which is now storing multiple values.
> >>>CGI->Vars stores multi-values as a sting separated by a null byte.
> >>>
> >>Thats bad...
> >>
> >>>Patch attached, Added parse_args(), fixed indenting.
> >>>
> >>Thanks, half applied...(Apache::MVC already has parse_args)
> >
> >Thanks. It looks like you applied the part that didn't fix the CGI->Vars
> >problem. I only added indentation fixes and added parse_args() to clean it up
> >and bring the API more into line with Apache::MVC.
> >
> >In case I wasn't clear about the CGI->Vars problem, I'll give an example. The
> >following maypole request:
> > /table/edit/10?foo=bar;foo=baz
> >
> >will be handled differently by CGI::Maypole:
> >
> >CGI::Maypole: $r->{params}{foo} = "bar\0baz"
> >Apache::MVC: $r->{params}{foo} = [qw(bar baz)]
> >Maypole::CLI: $r->{params}{foo} = [qw(bar baz)]
> >
> >The fix in the patch I send will store the multivalued 'foo' as an arrayref in
> >the same way as the other backends.
> >
> The problem is clear, thanks, but there is no fix for that in the
> patches you send me yesterday...
Perhaps you missed it because of the unrelated changes. This was the relevant
addition in CGI-Maypole-parse_args.diff:
+sub parse_args {
+ my $self = shift;
+ my (%vars) = $self->{cgi}->Vars;
+ while (my ($key, $value) = each %vars) {
+ my @values = split "\0", $value;
+ $vars{$key} = @values == 1 ? $values[0] : \@values;
+ }
+ $self->{params} = { %vars };
+ $self->{query} = { %vars };
+}
--simonflk
_______________________________________________
maypole-dev mailing list
maypole-dev at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole-dev
This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:56 GMT