From 8d936b0c05e90b3dc07a33595f24ddf30cbcc10e Mon Sep 17 00:00:00 2001 From: kink Date: Wed, 23 Oct 2002 15:12:13 +0000 Subject: [PATCH] In sqimap_logout, check if we have a stream to logout to. If we don't, logging out is not neccessary. This prevents an endless loop of fgets when there's no connection anymore. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3952 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_general.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/functions/imap_general.php b/functions/imap_general.php index 008d0053..a34afc25 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -257,8 +257,10 @@ function sqimap_login ($username, $password, $imap_server_address, $imap_port, $ /* Simply logs out the IMAP session */ function sqimap_logout ($imap_stream) { - /* Logout is not valid until the server returns 'BYE' */ - sqimap_run_command($imap_stream, 'LOGOUT', false, $response, $message); + /* Logout is not valid until the server returns 'BYE' + * If we don't have an imap_ stream we're already logged out */ + if(isset($imap_stream)) + sqimap_run_command($imap_stream, 'LOGOUT', false, $response, $message); } function sqimap_capability($imap_stream, $capability='') { -- 2.25.1