From 0d57de907f0e2a64535097e573f863619373d5ce Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 23 Jan 2009 14:09:57 -0500
Subject: [PATCH] - Fix large search results on server without SORT capability (#1485668)

---
 CHANGELOG                      |    1 +
 program/include/rcube_imap.php |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 94559b7..5d5c532 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,6 +6,7 @@
 - Fix creation of folders with '&' sign in name
 - Fix parsing of email addresses without angle brackets (#1485693)
 - Save spellcheck corrections when switching from plain to html editor (and spellchecking is on)
+- Fix large search results on server without SORT capability (#1485668)
 
 2009/01/22 (thomasb)
 ----------
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index f8737e3..287c3ee 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -687,7 +687,7 @@
         // use memory less expensive (and quick) method for big result set
 	$a_index = $this->message_index($mailbox, $this->sort_field, $this->sort_order);
         // get messages uids for one page...
-        $msgs = array_slice(array_keys($a_index), $start_msg, min($cnt-$start_msg, $this->page_size));
+        $msgs = array_slice($a_index, $start_msg, min($cnt-$start_msg, $this->page_size));
 	// ...and fetch headers
         $this->_fetch_headers($mailbox, join(',', $msgs), $a_msg_headers, NULL);
 

--
Gitblit v1.9.1