diff options
author | alecpl <alec@alec.pl> | 2011-09-21 12:22:40 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2011-09-21 12:22:40 +0000 |
commit | 075e9d5ba25ece5b7fed5470efb38272d519fa27 (patch) | |
tree | 1800c01a0d5a0f1cd0f8b05e63070981972aeddb /program/include/rcube_imap.php | |
parent | b578abb9f94fa1d7dc8ce2ee94e35fa074d51ce4 (diff) |
- Applied fixes from trunk up to r5259
Diffstat (limited to 'program/include/rcube_imap.php')
-rw-r--r-- | program/include/rcube_imap.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php index 7147c14d5..5f476aba4 100644 --- a/program/include/rcube_imap.php +++ b/program/include/rcube_imap.php @@ -1505,7 +1505,10 @@ class rcube_imap // use message index sort as default sorting if (!$this->sort_field) { if ($this->skip_deleted) { - $a_index = $this->_search_index($mailbox, 'ALL'); + $a_index = $this->conn->search($mailbox, 'ALL UNDELETED'); + // I didn't found that SEARCH should return sorted IDs + if (is_array($a_index)) + sort($a_index); } else if ($max = $this->_messagecount($mailbox)) { $a_index = range(1, $max); } @@ -2491,17 +2494,17 @@ class rcube_imap return true; } - // Remove NULL characters (#1486189) - $body = str_replace("\x00", '', $body); - // convert charset (if text or message part) - if ($body && !$skip_charset_conv && - preg_match('/^(text|message)$/', $o_part->ctype_primary) - ) { - if (!$o_part->charset || strtoupper($o_part->charset) == 'US-ASCII') { - $o_part->charset = $this->default_charset; + if ($body && preg_match('/^(text|message)$/', $o_part->ctype_primary)) { + // Remove NULL characters (#1486189) + $body = str_replace("\x00", '', $body); + + if (!$skip_charset_conv) { + if (!$o_part->charset || strtoupper($o_part->charset) == 'US-ASCII') { + $o_part->charset = $this->default_charset; + } + $body = rcube_charset_convert($body, $o_part->charset); } - $body = rcube_charset_convert($body, $o_part->charset); } return $body; |