diff options
| author | sparc <sparc@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2005-10-20 15:57:53 +0000 |
|---|---|---|
| committer | sparc <sparc@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2005-10-20 15:57:53 +0000 |
| commit | c9dd57c05935c003da4dfb04278288d49498ed2a (patch) | |
| tree | a5fd7a6f8ba93909140eb5a294142a9504348b9a /roundcubemail/program/include | |
| parent | 7344d2540eafce525d67ae8395d74eeaa09bdfc3 (diff) | |
fixed some warnings
git-svn-id: https://svn.roundcube.net/trunk@44 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
| -rw-r--r-- | roundcubemail/program/include/rcube_imap.inc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/roundcubemail/program/include/rcube_imap.inc b/roundcubemail/program/include/rcube_imap.inc index 4c707e3bb..a6e8d78a2 100644 --- a/roundcubemail/program/include/rcube_imap.inc +++ b/roundcubemail/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; |
