From 61858962b06866a330960bd161591b000e26ae63 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Sat, 21 Dec 2013 17:42:14 +0100 Subject: Bug 748095: Bugzilla crashes when the shutdownhtml parameter is set and using a non-cookie based authentication method r=dkl a=justdave --- Bugzilla/Auth/Persist/Cookie.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Bugzilla') diff --git a/Bugzilla/Auth/Persist/Cookie.pm b/Bugzilla/Auth/Persist/Cookie.pm index 9681bcea2..939a1ac9c 100644 --- a/Bugzilla/Auth/Persist/Cookie.pm +++ b/Bugzilla/Auth/Persist/Cookie.pm @@ -108,8 +108,8 @@ sub logout { if ($cookie) { push(@login_cookies, $cookie->value); } - else { - push(@login_cookies, $cgi->cookie("Bugzilla_logincookie")); + elsif ($cookie = $cgi->cookie('Bugzilla_logincookie')) { + push(@login_cookies, $cookie); } # If we are a webservice using a token instead of cookie @@ -118,7 +118,8 @@ sub logout { push(@login_cookies, $login_token->{'login_token'}); } - return if !@login_cookies; + # Make sure that @login_cookies is not empty to not break SQL statements. + push(@login_cookies, '') unless @login_cookies; # These queries use both the cookie ID and the user ID as keys. Even # though we know the userid must match, we still check it in the SQL -- cgit v1.2.3-24-g4f1b