diff options
author | svncommit <devs@roundcube.net> | 2005-10-20 15:57:53 +0000 |
---|---|---|
committer | svncommit <devs@roundcube.net> | 2005-10-20 15:57:53 +0000 |
commit | 8c032834657a770a87ab1bb1dda59db5f9deed82 (patch) | |
tree | d2dd074c876ebdc7938866bd2af472d340905e9b /program/include | |
parent | f45ec7e91895c9de8c9c244a174f34220de0d9ab (diff) |
fixed some warnings
Diffstat (limited to 'program/include')
-rw-r--r-- | program/include/rcube_imap.inc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc index 4c707e3bb..a6e8d78a2 100644 --- a/program/include/rcube_imap.inc +++ b/program/include/rcube_imap.inc @@ -311,9 +311,11 @@ class rcube_imap { $a_header_index = iil_C_FetchHeaders($this->conn, $mailbox, "1:$max"); $a_msg_headers = array(); - foreach ($a_header_index as $i => $headers) - if (!$headers->deleted) - $a_msg_headers[$headers->uid] = $headers; + + if (!empty($a_header_index)) + foreach ($a_header_index as $i => $headers) + if (!$headers->deleted) + $a_msg_headers[$headers->uid] = $headers; // print "/**** fetch headers ****/\n"; } @@ -325,6 +327,7 @@ class rcube_imap // sort headers by a specific col $a_headers = iil_SortHeaders($a_msg_headers, $sort_field, $sort_order); + // free memory unset($a_msg_headers); @@ -332,6 +335,9 @@ class rcube_imap if (!$headers_cached) $this->update_cache($mailbox.'.msg', $a_headers); + if (empty($a_headers)) + return array(); + // return complete list of messages if (strtolower($page)=='all') return $a_headers; |