From 4845a1ea952f4affda3546abd7dfa02d24fc818c Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Tue, 11 Sep 2007 04:45:41 -0400
Subject: [PATCH] Fixed message search issues

---
 program/include/rcube_imap.inc |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc
index 46c0d1a..41cc1cc 100644
--- a/program/include/rcube_imap.inc
+++ b/program/include/rcube_imap.inc
@@ -287,7 +287,7 @@
       
     $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 @@
       $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 @@
       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)

--
Gitblit v1.9.1