summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_imap.php2
-rw-r--r--program/include/rcube_imap_generic.php2
-rw-r--r--program/include/rcube_result_index.php8
3 files changed, 8 insertions, 4 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 5e36f16c5..4e1d57155 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -1213,7 +1213,9 @@ class rcube_imap extends rcube_storage
}
// use message index sort as default sorting
else if (!$sort_field) {
+ // use search result from count() if possible
if ($this->options['skip_deleted'] && !empty($this->icache['undeleted_idx'])
+ && $this->icache['undeleted_idx']->get_parameters('ALL') !== null
&& $this->icache['undeleted_idx']->get_parameters('MAILBOX') == $folder
) {
$index = $this->icache['undeleted_idx'];
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index a664c5b57..52459dd78 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -1650,7 +1650,7 @@ class rcube_imap_generic
// If ESEARCH is supported always use ALL
// but not when items are specified or using simple id2uid search
- if (empty($items) && ((int) $criteria != $criteria)) {
+ if (empty($items) && preg_match('/[^0-9]/', $criteria)) {
$items = array('ALL');
}
diff --git a/program/include/rcube_result_index.php b/program/include/rcube_result_index.php
index 1c7a5e067..cd900677e 100644
--- a/program/include/rcube_result_index.php
+++ b/program/include/rcube_result_index.php
@@ -89,18 +89,18 @@ class rcube_result_index
$param = strtoupper($m[1]);
$value = $m[2];
- $this->params[strtoupper($m[1])] = $value;
+ $this->params[$param] = $value;
$data_item = substr($data_item, strlen($m[0]));
if (in_array($param, array('COUNT', 'MIN', 'MAX'))) {
- $this->meta[strtolower($param)] = (int) $m[2];
+ $this->meta[strtolower($param)] = (int) $value;
}
}
// @TODO: Implement compression using compressMessageSet() in __sleep() and __wakeup() ?
// @TODO: work with compressed result?!
if (isset($this->params['ALL'])) {
- $data[$idx] = implode(self::SEPARATOR_ELEMENT,
+ $data_item = implode(self::SEPARATOR_ELEMENT,
rcube_imap_generic::uncompressMessageSet($this->params['ALL']));
}
}
@@ -111,6 +111,8 @@ class rcube_result_index
unset($data[$i]);
}
+ $data = array_filter($data);
+
if (empty($data)) {
return;
}