summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--program/include/rcube_imap.inc8
-rw-r--r--program/steps/mail/search.inc2
2 files changed, 5 insertions, 5 deletions
diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc
index 46c0d1aeb..41cc1cca5 100644
--- a/program/include/rcube_imap.inc
+++ b/program/include/rcube_imap.inc
@@ -287,7 +287,7 @@ class rcube_imap
$this->search_subject = $subject;
$this->search_string = $str;
- $this->search_set = is_array($msgs) ? $msgs : NULL;
+ $this->search_set = (array)$msgs;
$this->search_charset = $charset;
}
@@ -439,8 +439,8 @@ class rcube_imap
$mailbox = $this->mailbox;
// count search set
- if ($this->search_set && $mailbox == $this->mailbox && $mode == 'ALL')
- return count($this->search_set);
+ if ($this->search_string && $mailbox == $this->mailbox && $mode == 'ALL')
+ return count((array)$this->search_set);
$a_mailbox_cache = $this->get_cache('messagecount');
@@ -522,7 +522,7 @@ class rcube_imap
return array();
// use saved message set
- if ($this->search_set && $mailbox == $this->mailbox)
+ if ($this->search_string && $mailbox == $this->mailbox)
return $this->_list_header_set($mailbox, $this->search_set, $page, $sort_field, $sort_order);
if ($sort_field!=NULL)
diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc
index bef821b40..a3f6dda66 100644
--- a/program/steps/mail/search.inc
+++ b/program/steps/mail/search.inc
@@ -78,7 +78,7 @@ if (is_array($result) && $result[0] != '')
{
// Get the headers
$result_h = $IMAP->list_header_set($mbox, $result, 1, $_SESSION['sort_col'], $_SESSION['sort_order']);
- $count = count($result_h);
+ $count = $IMAP->messagecount();
// save search results in session
if (!is_array($_SESSION['search']))