Przeglądaj źródła

Send Correct FETCH when Folder is Suddenly Empty

Andy 6 lat temu
rodzic
commit
7ebdd3e39e
1 zmienionych plików z 5 dodań i 2 usunięć
  1. 5 2
      functions/imap_messages.php

+ 5 - 2
functions/imap_messages.php

@@ -294,7 +294,9 @@ function get_squirrel_sort($imap_stream, $sSortField, $reverse = false, $aUid =
             $sSortField = 'SIZE';
         }
         foreach ($msgs as $item) {
-            $aUid[$item['UID']] = (isset($item[$sSortField])) ? $item[$sSortField] : 0;
+            if (array_key_exists('UID', $item)) {
+                $aUid[$item['UID']] = (isset($item[$sSortField])) ? $item[$sSortField] : 0;
+            }
         }
         if ($reverse) {
             arsort($aUid,SORT_NUMERIC);
@@ -577,7 +579,8 @@ function sqimap_get_small_header_list($imap_stream, $msg_list,
                 $aMessageList["$msg_list[$i]"] = array();
             }
         }
-    } else {
+    }
+    if (empty($msgs_str)) {
         $msgs_str = '1:*';
     }