+ if ($opt eq "exclude") { %common_exclude = %{$val}; }
+ if ($opt eq "include") { %common_include = %{$val}; }
+ if ($opt eq "raw") { $common_raw_sort = $val; }
+ if ($opt eq "bug-rev") { $common_bug_reverse = $val; }
+ if ($opt eq "pend-rev") { $common_pending_reverse = $val; }
+ if ($opt eq "sev-rev") { $common_severity_reverse = $val; }
+ if ($opt eq "pend-exc") {
+ my @vals;
+ @vals = ( $val ) if (ref($val) eq "" && $val );
+ @vals = ( $$val ) if (ref($val) eq "SCALAR" && $$val );
+ @vals = @{$val} if (ref($val) eq "ARRAY" );
+ @common_pending_exclude = @vals if (@vals);
+ }
+ if ($opt eq "pend-inc") {
+ my @vals;
+ @vals = ( $val, ) if (ref($val) eq "" && $val );
+ @vals = ( $$val, ) if (ref($val) eq "SCALAR" && $$val );
+ @vals = @{$val} if (ref($val) eq "ARRAY" );
+ @common_pending_include = @vals if (@vals);
+ }
+ if ($opt eq "sev-exc") {
+ my @vals;
+ @vals = ( $val ) if (ref($val) eq "" && $val );
+ @vals = ( $$val ) if (ref($val) eq "SCALAR" && $$val );
+ @vals = @{$val} if (ref($val) eq "ARRAY" );
+ @common_severity_exclude = @vals if (@vals);
+ }
+ if ($opt eq "sev-inc") {
+ my @vals;
+ @vals = ( $val ) if (ref($val) eq "" && $val );
+ @vals = ( $$val ) if (ref($val) eq "SCALAR" && $$val );
+ @vals = @{$val} if (ref($val) eq "ARRAY" );
+ @common_severity_include = @vals if (@vals);
+ }
+}
+
+sub readparse {
+ my ($in, $key, $val, %ret);
+ if (defined $ENV{"QUERY_STRING"} && $ENV{"QUERY_STRING"} ne "") {
+ $in=$ENV{QUERY_STRING};
+ } elsif(defined $ENV{"REQUEST_METHOD"}
+ && $ENV{"REQUEST_METHOD"} eq "POST")
+ {
+ read(STDIN,$in,$ENV{CONTENT_LENGTH});
+ } else {
+ return;
+ }
+ foreach (split(/[&;]/,$in)) {
+ s/\+/ /g;
+ ($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");
+ return %ret;