[Svn] r4254 - trunk/roundcubemail/program/include

trac at roundcube.net trac at roundcube.net
Tue Nov 23 20:26:12 CET 2010


Author: alec
Date: 2010-11-23 13:26:11 -0600 (Tue, 23 Nov 2010)
New Revision: 4254

Modified:
   trunk/roundcubemail/program/include/rcube_imap.php
Log:
- Fix PHP warning: check if array isn't empty before using max()


Modified: trunk/roundcubemail/program/include/rcube_imap.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap.php	2010-11-23 11:21:10 UTC (rev 4253)
+++ trunk/roundcubemail/program/include/rcube_imap.php	2010-11-23 19:26:11 UTC (rev 4254)
@@ -693,7 +693,8 @@
             $result = array(
                 'count'    => count($this->icache['threads']['tree']),
                 'msgcount' => count($this->icache['threads']['depth']),
-                'maxuid'   => max(array_keys($this->icache['threads']['depth'])),
+                'maxuid'   => !empty($this->icache['threads']['depth']) ?
+                    max(array_keys($this->icache['threads']['depth'])) : 0,
             );
         }
         else if (is_array($result = $this->_fetch_threads($mailbox))) {
@@ -702,7 +703,7 @@
             $result = array(
                 'count'    => count($result[0]),
                 'msgcount' => count($result[1]),
-                'maxuid'   => max(array_keys($result[1])),
+                'maxuid'   => !empty($result[1]) ? max(array_keys($result[1])) : 0,
             );
         }
 

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list