Kaynağa Gözat

Minor fix and clarify return types

pdontthink 7 yıl önce
ebeveyn
işleme
2286ff20d9
1 değiştirilmiş dosya ile 4 ekleme ve 0 silme
  1. 4 0
      functions/mailbox_display.php

+ 4 - 0
functions/mailbox_display.php

@@ -30,6 +30,8 @@
  *                                (OPTIONAL; default is TRUE)
  *                                (OPTIONAL; default is TRUE)
  *
  *
  * @return array   $aMailbox mailbox array with all relevant information
  * @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
  * @since 1.5.1
  * @author Marc Groot Koerkamp
  * @author Marc Groot Koerkamp
@@ -56,6 +58,8 @@ function sqm_api_mailbox_select($imapConnection,$account,$mailbox,$aConfig,$aPro
     $iSetIndx = $aConfig['setindex'];
     $iSetIndx = $aConfig['setindex'];
 
 
     $aMbxResponse = sqimap_mailbox_select($imapConnection, $mailbox, $handle_errors);
     $aMbxResponse = sqimap_mailbox_select($imapConnection, $mailbox, $handle_errors);
+    if (empty($aMbxResponse))
+       return $aMbxResponse;
 
 
     if ($mailbox_cache) {
     if ($mailbox_cache) {
         if (isset($mailbox_cache[$account.'_'.$mailbox])) {
         if (isset($mailbox_cache[$account.'_'.$mailbox])) {