On Tue, 23 Jan 2001, Geoffrey Young wrote:

> hi all...
> 
> I made a patch for this.  It may not be as neat as Doug's one liner, but
> it's pretty much the same as CGI.pm and returns undef for the empty value
> (which is consistent with libapreq)
> 
> for some reason I can't get it past the internal/taint test, though
> (t/net/perl/taint.pl)
> 
> am I missing something major?  maybe taint.pl only worked because args() was
> bad?

this passes all tests for me..

Index: Apache/Apache.pm
===================================================================
RCS file: /home/cvs/modperl/Apache/Apache.pm,v
retrieving revision 1.60
diff -u -r1.60 Apache.pm
--- Apache/Apache.pm    2000/12/20 08:07:34     1.60
+++ Apache/Apache.pm    2001/01/25 07:57:28
@@ -38,7 +38,14 @@
     my($wantarray,$string) = @_;
     return unless defined $string and $string;
     if(defined $wantarray and $wantarray) {
-       return map { Apache::unescape_url_info($_) } split /[=&;]/, $string, -1;
+        my @args;
+        local $_;
+        for my $pair (split /[&;]/, $string) {
+            for (split '=', $pair) {
+                push @args, $_ ? Apache::unescape_url_info($_) : undef;
+            }
+        }
+        return @args;
     }
     $string;
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to