Changeset 4254 in subversion


Ignore:
Timestamp:
Nov 23, 2010 2:26:11 PM (2 years ago)
Author:
alec
Message:
  • Fix PHP warning: check if array isn't empty before using max()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_imap.php

    r4233 r4254  
    694694                'count'    => count($this->icache['threads']['tree']), 
    695695                'msgcount' => count($this->icache['threads']['depth']), 
    696                 'maxuid'   => max(array_keys($this->icache['threads']['depth'])), 
     696                'maxuid'   => !empty($this->icache['threads']['depth']) ? 
     697                    max(array_keys($this->icache['threads']['depth'])) : 0, 
    697698            ); 
    698699        } 
     
    703704                'count'    => count($result[0]), 
    704705                'msgcount' => count($result[1]), 
    705                 'maxuid'   => max(array_keys($result[1])), 
     706                'maxuid'   => !empty($result[1]) ? max(array_keys($result[1])) : 0, 
    706707            ); 
    707708        } 
Note: See TracChangeset for help on using the changeset viewer.