From 49838aefe6590fd9a5474853beb5c7d937029534 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Mon, 13 Nov 2006 11:07:57 +0000 Subject: Bug 360028: Bugzilla::Search::Saved should have create() and update(), and buglist.cgi should use it Patch By Max Kanat-Alexander r=LpSolit, a=justdave --- Bugzilla/CGI.pm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'Bugzilla/CGI.pm') diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm index 091362306..7b76f6af0 100644 --- a/Bugzilla/CGI.pm +++ b/Bugzilla/CGI.pm @@ -135,6 +135,31 @@ sub canonicalise_query { return join("&", @parameters); } +sub clean_search_url { + my $self = shift; + # Delete any empty URL parameter + my @cgi_params = $self->param; + + foreach my $param (@cgi_params) { + if (defined $self->param($param) && $self->param($param) eq '') { + $self->delete($param); + $self->delete("${param}_type"); + } + + # Boolean Chart stuff is empty if it's "noop" + if ($param =~ /\d-\d-\d/ && defined $self->param($param) + && $self->param($param) eq 'noop') + { + $self->delete($param); + } + } + + # Delete certain parameters if the associated parameter is empty. + $self->delete('bugidtype') if !$self->param('bug_id'); + $self->delete('emailtype1') if !$self->param('email1'); + $self->delete('emailtype2') if !$self->param('email2'); +} + # Overwrite to ensure nph doesn't get set, and unset HEADERS_ONCE sub multipart_init { my $self = shift; -- cgit v1.2.3-24-g4f1b