Seriously? The variable is named as an array and initialized as a string? Well, I...
[squirrelmail.git] / functions / imap_general.php
index f7459e2d6474cb13b05ec9c4e0264f5ee244449c..943b952f8431fcd076d37c27bb73d7e55fef797f 100755 (executable)
@@ -5,7 +5,7 @@
  *
  * This implements all functions that do general IMAP functions.
  *
- * @copyright 1999-2016 The SquirrelMail Project Team
+ * @copyright 1999-2017 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -410,7 +410,7 @@ function sqimap_retrieve_imap_response($imap_stream, $tag, $handle_errors,
     $read = '';
     if (!is_array($message)) $message = array();
     if (!is_array($response)) $response = array();
-    $aResponse = '';
+    $aResponse = array();
     $resultlist = array();
     $data = array();
     $sCommand = '';
@@ -1063,8 +1063,10 @@ function sqimap_login ($username, $password, $imap_server_address,
 function sqimap_logout ($imap_stream) {
     /* 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) && $imap_stream)
+    if(isset($imap_stream) && $imap_stream) {
         sqimap_run_command($imap_stream, 'LOGOUT', false, $response, $message);
+        fclose($imap_stream);
+    }
 }
 
 /**