summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-07-11 09:28:36 +0200
committerAleksander Machniak <alec@alec.pl>2014-07-11 09:28:36 +0200
commit4922e55d582fb1907211bba8cc539551475f280f (patch)
treed0198a94d1772ecfe7ab863ddc5d480ba1bf9a67
parentac0ec6d546b283c8a125abd6a03b31fc908346b9 (diff)
Fix sorting messages by size on servers without SORT capability (#1489981)
-rw-r--r--CHANGELOG1
-rw-r--r--program/lib/Roundcube/rcube_imap_generic.php4
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index aa22fb0e3..79148e033 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -57,6 +57,7 @@ CHANGELOG Roundcube Webmail
- Fix Delete button state after deleting identity/response (#1489972)
- Fix bug where contacts with no email address were listed on compose addressbook (#1489970)
- Fix images import from various vCard formats (#1489977)
+- Fix sorting messages by size on servers without SORT capability (#1489981)
RELEASE 1.0.1
-------------
diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php
index 032506412..99fb6d861 100644
--- a/program/lib/Roundcube/rcube_imap_generic.php
+++ b/program/lib/Roundcube/rcube_imap_generic.php
@@ -1916,8 +1916,8 @@ class rcube_imap_generic
$result[$id] = '';
}
} else if ($mode == 2) {
- if (preg_match('/(UID|RFC822\.SIZE) ([0-9]+)/', $line, $matches)) {
- $result[$id] = trim($matches[2]);
+ if (preg_match('/' . $index_field . ' ([0-9]+)/', $line, $matches)) {
+ $result[$id] = trim($matches[1]);
} else {
$result[$id] = 0;
}