summaryrefslogtreecommitdiffstats
path: root/CGI.pl
diff options
context:
space:
mode:
authorgerv%gerv.net <>2002-10-08 15:41:17 +0200
committergerv%gerv.net <>2002-10-08 15:41:17 +0200
commitf1ddf54f4cfc06d99ded78e496c45b324fc0815d (patch)
treec7f951c72da4494d8828a2a6587300c4d578fa89 /CGI.pl
parent5cdbfa01288bb9739fe080e6f443d8672992cea3 (diff)
downloadbugzilla-f1ddf54f4cfc06d99ded78e496c45b324fc0815d.tar.gz
bugzilla-f1ddf54f4cfc06d99ded78e496c45b324fc0815d.tar.xz
Bug 171437 - Enhancements to generic reporting. Reporting menu, 3D tables, rearranged UI, better API for new report types. Patch by gerv; r=joel.
Diffstat (limited to 'CGI.pl')
-rw-r--r--CGI.pl29
1 files changed, 29 insertions, 0 deletions
diff --git a/CGI.pl b/CGI.pl
index 3d6752a57..20f257d60 100644
--- a/CGI.pl
+++ b/CGI.pl
@@ -199,6 +199,35 @@ sub ProcessMultipartFormFields {
}
}
+sub CanonicaliseParams {
+ my ($buffer, $exclude) = (@_);
+ my %pieces;
+
+ # Split the buffer up into key/value pairs, and store the non-empty ones
+ my @args = split('&', $buffer);
+
+ foreach my $arg (@args) {
+ my ($name, $value) = split('=', $arg, 2);
+
+ if ($value) {
+ push(@{$pieces{$name}}, $value);
+ }
+ }
+
+ # Reconstruct the URL by concatenating the sorted param=value pairs
+ my @parameters;
+ foreach my $key (sort keys %pieces) {
+ # Leave this key out if it's in the exclude list
+ next if lsearch($exclude, $key) != -1;
+
+ foreach my $value (@{$pieces{$key}}) {
+ push(@parameters, "$key=$value");
+ }
+ }
+
+ return join("&", @parameters);
+}
+
# check and see if a given field exists, is non-empty, and is set to a
# legal value. assume a browser bug and abort appropriately if not.
# if $legalsRef is not passed, just check to make sure the value exists and