]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2001-11-17 06:34:05 by doogie]
authordoogie <>
Sat, 17 Nov 2001 14:34:05 +0000 (06:34 -0800)
committerdoogie <>
Sat, 17 Nov 2001 14:34:05 +0000 (06:34 -0800)
If multiple values are detected in the url(foo=1&foo=2&foo=3), create an
additional entry in the returned hash of the form "&foo", which is a
reference to a list, and push all values found onto it.  "foo" in the
returned hash has the last value found, in this case, "3".

cgi/common.pl

index 9ae3acb6291a20ab08ac3f462f7506309b8af642..9f6d13c63096076618fefedc523d8dd750066e3f 100644 (file)
@@ -34,6 +34,12 @@ sub readparse {
         ($key, $val) = split(/=/,$_,2);
         $key=~s/%(..)/pack("c",hex($1))/ge;
         $val=~s/%(..)/pack("c",hex($1))/ge;
+       if ( exists $ret{$key} ) {
+           if ( !exists $ret{"&$key"} ) {
+               $ret{"&$key"} = [ $ret{$key} ];
+           }
+           push @{$ret{"&$key"}},$val;
+       }
         $ret{$key}=$val;
     }
 $debug = 1 if (defined $ret{"debug"} && $ret{"debug"} eq "aj");