diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-12-07 13:09:13 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-12-07 13:09:13 +0000 |
| commit | 50c7e79416d6909086cd3d0190d1eb00d318eba0 (patch) | |
| tree | 1af1ea6e0ba27fdd563db1b35dee642e79e68962 /plugins | |
| parent | dd49527a59bb156215458c38a0c538201dab0669 (diff) | |
Fix: searches can have zero results
git-svn-id: https://svn.roundcube.net/trunk@4313 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/kolab_addressbook/rcube_kolab_contacts.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/kolab_addressbook/rcube_kolab_contacts.php b/plugins/kolab_addressbook/rcube_kolab_contacts.php index d23e3db7a..a2400d05f 100644 --- a/plugins/kolab_addressbook/rcube_kolab_contacts.php +++ b/plugins/kolab_addressbook/rcube_kolab_contacts.php @@ -187,7 +187,7 @@ class rcube_kolab_contacts extends rcube_addressbook $this->result->count = 0; foreach ((array)$this->distlists[$this->gid]['member'] as $member) { // skip member that don't match the search filter - if ($this->filter && array_search($member['ID'], $this->filter) === false) + if (is_array($this->filter) && array_search($member['ID'], $this->filter) === false) continue; if ($this->contacts[$member['ID']] && !$seen[$member['ID']]++) $this->result->count++; @@ -195,7 +195,7 @@ class rcube_kolab_contacts extends rcube_addressbook $ids = array_keys($seen); } else - $ids = $this->filter ? $this->filter : array_keys($this->contacts); + $ids = is_array($this->filter) ? $this->filter : array_keys($this->contacts); // fill contact data into the current result set $i = $j = 0; @@ -271,7 +271,7 @@ class rcube_kolab_contacts extends rcube_addressbook { $this->_fetch_contacts(); $this->_fetch_groups(); - $count = $this->gid ? count($this->distlists[$this->gid]['member']) : ($this->filter ? count($this->filter) : count($this->contacts)); + $count = $this->gid ? count($this->distlists[$this->gid]['member']) : (is_array($this->filter) ? count($this->filter) : count($this->contacts)); return new rcube_result_set($count, ($this->list_page-1) * $this->page_size); } |
