Re: CGI.pm and QUERY_STRING fixup
On Tue, 25 Jan 2000, Bill Moseley wrote: > Ok, this seems to work, but perldoc Apache doesn't say anything about > setting it. Is this at risk of not working in the future? you can set $r->args, that won't be going away in the future.
Re: CGI.pm and QUERY_STRING fixup
On Mon, 24 Jan 2000, Bill Moseley wrote: ... > Under mod_cgi I can clean up $ENV{QUERY_STRING} at the start of a program > by removing leading '&' and double '&', but that doesn't work, obviously, > under mod_perl. > > Could someone suggest a way to clean up the query string from within an > Apache::Registry script? Is it possible to just write a cleaned up query > string to args() at the start of my Registry script, or is that too late in > the request? PerlFixupHandler would be the best place to fixup $r->args
Re: CGI.pm and QUERY_STRING fixup
Ok, this seems to work, but perldoc Apache doesn't say anything about setting it. Is this at risk of not working in the future? if ( $RUNNING_MOD_PERL && (my $query = Apache->request->args() ) ) { for ( $query ) { tr/&/&/s; # no muliple & s/^&//; # no leading & } Apache->request->args( $query ); } $r->args The $r->args method will return the contents of the URI query string. When called in a scalar context, the entire string is returned. When called in a list context, a list of parsed key => value pairs are returned, i.e. it can be used like this: $query = $r->args; %in= $r->args; Bill Moseley mailto:[EMAIL PROTECTED]