Skip to content

Commit

Permalink
Fix wrong search result on servers without SORT support
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Aug 11, 2012
1 parent 3d8eef3 commit 002d1a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions program/include/rcube_imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1015,8 +1015,8 @@ protected function list_search_messages($folder, $page, $slice=0)
$a_msg_headers, $this->sort_field, $this->sort_order);

// only return the requested part of the set
$a_msg_headers = array_slice(array_values($a_msg_headers),
$from, min($cnt-$to, $this->page_size));
$slice_length = min($this->page_size, $cnt - ($to > $cnt ? $from : $to));
$a_msg_headers = array_slice(array_values($a_msg_headers), $from, $slice_length);

if ($slice) {
$a_msg_headers = array_slice($a_msg_headers, -$slice, $slice);
Expand Down

0 comments on commit 002d1a4

Please sign in to comment.