summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_imap.php
diff options
context:
space:
mode:
Diffstat (limited to 'program/lib/Roundcube/rcube_imap.php')
-rw-r--r--program/lib/Roundcube/rcube_imap.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index db94e7678..0cf34b2ca 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -969,7 +969,7 @@ class rcube_imap extends rcube_storage
$to = $from + $page_size;
// sort headers
- if (!$this->threading) {
+ if (!$this->threading && !empty($a_msg_headers)) {
$a_msg_headers = $this->conn->sortHeaders($a_msg_headers, $this->sort_field, $this->sort_order);
}
@@ -1476,10 +1476,8 @@ class rcube_imap extends rcube_storage
new rcube_result_index; // trigger autoloader and make these classes available for threaded context
new rcube_result_thread;
- // connect IMAP
- if (!defined('PTHREADS_INHERIT_ALL')) {
- $this->check_connection();
- }
+ // connect IMAP to have all the required classes and settings loaded
+ $this->check_connection();
$searcher = new rcube_imap_search($this->options, $this->conn);
$results = $searcher->exec(