From: Ed Morley Date: Thu, 10 Jul 2014 06:28:31 +0000 (+0800) Subject: Bug 1032323: canonicalise_query() should omit parameters with empty values so generat... X-Git-Tag: bugzilla-4.5.5~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=515a56de63c46fa3717ec853282d700dadd0c47d;p=thirdparty%2Fbugzilla.git Bug 1032323: canonicalise_query() should omit parameters with empty values so generated URLs are shorter r=glob,a=sgreen --- diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm index 48b4fb0bfa..656c462b71 100644 --- a/Bugzilla/CGI.pm +++ b/Bugzilla/CGI.pm @@ -124,7 +124,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"); @@ -659,7 +660,9 @@ I also includes additional functions. =item C -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