From 89b0758560a83dd5f66608725bffb0ef403e2a05 Mon Sep 17 00:00:00 2001 From: doogie <> Date: Sat, 17 Nov 2001 06:34:05 -0800 Subject: [PATCH] [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". --- cgi/common.pl | 6 ++++++ 1 file changed, 6 insertions(+) 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"); -- 2.39.5