Changeset 4313 in subversion


Ignore:
Timestamp:
Dec 7, 2010 8:09:13 AM (2 years ago)
Author:
thomasb
Message:

Fix: searches can have zero results

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/kolab_addressbook/rcube_kolab_contacts.php

    r4299 r4313  
    188188            foreach ((array)$this->distlists[$this->gid]['member'] as $member) { 
    189189                // skip member that don't match the search filter 
    190                 if ($this->filter && array_search($member['ID'], $this->filter) === false) 
     190                if (is_array($this->filter) && array_search($member['ID'], $this->filter) === false) 
    191191                    continue; 
    192192                if ($this->contacts[$member['ID']] && !$seen[$member['ID']]++) 
     
    196196        } 
    197197        else 
    198             $ids = $this->filter ? $this->filter : array_keys($this->contacts); 
     198            $ids = is_array($this->filter) ? $this->filter : array_keys($this->contacts); 
    199199         
    200200        // fill contact data into the current result set 
     
    272272        $this->_fetch_contacts(); 
    273273        $this->_fetch_groups(); 
    274         $count = $this->gid ? count($this->distlists[$this->gid]['member']) : ($this->filter ? count($this->filter) : count($this->contacts)); 
     274        $count = $this->gid ? count($this->distlists[$this->gid]['member']) : (is_array($this->filter) ? count($this->filter) : count($this->contacts)); 
    275275        return new rcube_result_set($count, ($this->list_page-1) * $this->page_size); 
    276276    } 
Note: See TracChangeset for help on using the changeset viewer.