summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Morley <emorley@mozilla.com>2014-07-10 08:32:37 +0200
committerByron Jones <glob@mozilla.com>2014-07-10 08:32:37 +0200
commit0c7c657e2328a6da6db05f536acde166b7029658 (patch)
tree3442eb140f6acbe6830b3a5c08707ceb92ace1f7
parent3deb100b1d66fa2e4c9b8524d531f5c62aea0fa1 (diff)
downloadbugzilla-0c7c657e2328a6da6db05f536acde166b7029658.tar.gz
bugzilla-0c7c657e2328a6da6db05f536acde166b7029658.tar.xz
Bug 1032323: canonicalise_query() should omit parameters with empty values so generated URLs are shorter
-rw-r--r--Bugzilla/CGI.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm
index 64da0af28..0adb46a62 100644
--- a/Bugzilla/CGI.pm
+++ b/Bugzilla/CGI.pm
@@ -138,7 +138,8 @@ sub canonicalise_query {
my $esc_key = url_quote($key);
foreach my $value ($self->param($key)) {
- if (defined($value)) {
+ # Omit params with an empty value
+ if (defined($value) && $value ne '') {
my $esc_value = url_quote($value);
push(@parameters, "$esc_key=$esc_value");
@@ -658,7 +659,9 @@ I<Bugzilla::CGI> also includes additional functions.
=item C<canonicalise_query(@exclude)>
-This returns a sorted string of the parameters, suitable for use in a url.
+This returns a sorted string of the parameters whose values are non-empty,
+suitable for use in a url.
+
Values in C<@exclude> are not included in the result.
=item C<send_cookie>