summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-11-23 19:26:11 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-11-23 19:26:11 +0000
commit03cb865265b09ac5854fc9fe19431fe2b6359296 (patch)
tree3fe335a93031197e32901664dfa399537c446934 /roundcubemail/program/include
parent8a59a0ae0c5c144db060deaecee64fd7a5611311 (diff)
- Fix PHP warning: check if array isn't empty before using max()
git-svn-id: https://svn.roundcube.net/trunk@4254 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
-rw-r--r--roundcubemail/program/include/rcube_imap.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php
index 7becb4fce..468d98c40 100644
--- a/roundcubemail/program/include/rcube_imap.php
+++ b/roundcubemail/program/include/rcube_imap.php
@@ -693,7 +693,8 @@ class rcube_imap
$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 @@ class rcube_imap
$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,
);
}