Minor fix and clarify return types
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 18 Nov 2017 22:44:10 +0000 (22:44 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 18 Nov 2017 22:44:10 +0000 (22:44 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14735 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mailbox_display.php

index 42ae26cb13d08c91a1acf23aa02a9734da7a8d5a..0f63f04204365fa6460d58407cd0de94a87a245b 100644 (file)
@@ -30,6 +30,8 @@
  *                                (OPTIONAL; default is TRUE)
  *
  * @return array   $aMailbox mailbox array with all relevant information
+ *                           (if $handle_errors is false and there was an
+ *                           error, the array will be empty)
  *
  * @since 1.5.1
  * @author Marc Groot Koerkamp
@@ -56,6 +58,8 @@ function sqm_api_mailbox_select($imapConnection,$account,$mailbox,$aConfig,$aPro
     $iSetIndx = $aConfig['setindex'];
 
     $aMbxResponse = sqimap_mailbox_select($imapConnection, $mailbox, $handle_errors);
+    if (empty($aMbxResponse))
+       return $aMbxResponse;
 
     if ($mailbox_cache) {
         if (isset($mailbox_cache[$account.'_'.$mailbox])) {