From: doogie <> Date: Sat, 17 Nov 2001 14:34:05 +0000 (-0800) Subject: [project @ 2001-11-17 06:34:05 by doogie] X-Git-Tag: release/2.6.0~1091 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=89b0758560a83dd5f66608725bffb0ef403e2a05;p=debbugs.git [project @ 2001-11-17 06:34:05 by doogie] 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". --- diff --git a/cgi/common.pl b/cgi/common.pl index 9ae3acb6..9f6d13c6 100644 --- a/cgi/common.pl +++ b/cgi/common.pl @@ -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");