From 6a51c4c39e8ced6f808d5517d52c041d9305c2c0 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Tue, 7 Jul 2009 11:53:39 +0000 Subject: Bug 502641: Fix various problems that would occur when you would log in from buglist.cgi Patch by Max Kanat-Alexander r=LpSolit, a=LpSolit --- Bugzilla/CGI.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'Bugzilla') diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm index 6fb986aa5..1a1a1ac74 100644 --- a/Bugzilla/CGI.pm +++ b/Bugzilla/CGI.pm @@ -141,7 +141,7 @@ sub canonicalise_query { sub clean_search_url { my $self = shift; - # Delete any empty URL parameter + # Delete any empty URL parameter. my @cgi_params = $self->param; foreach my $param (@cgi_params) { @@ -161,6 +161,9 @@ sub clean_search_url { # Delete certain parameters if the associated parameter is empty. $self->delete('bugidtype') if !$self->param('bug_id'); + # Delete leftovers from the login form + $self->delete('Bugzilla_remember', 'GoAheadAndLogIn'); + foreach my $num (1,2) { # If there's no value in the email field, delete the related fields. if (!$self->param("email$num")) { @@ -299,6 +302,17 @@ sub param { return wantarray ? @result : $result[0]; } + # And for various other functions in CGI.pm, we need to correctly + # return the URL parameters in addition to the POST parameters when + # asked for the list of parameters. + elsif (!scalar(@_) && $self->request_method + && $self->request_method eq 'POST') + { + my @post_params = $self->SUPER::param; + my @url_params = $self->url_param; + my %params = map { $_ => 1 } (@post_params, @url_params); + return keys %params; + } return $self->SUPER::param(@_); } -- cgit v1.2.3-24-g4f1b