Thomas Bruederli
2013-10-21 f06aa8058b7e32ba32d4551074b6e0b8a300f751
program/steps/mail/search.inc
@@ -106,11 +106,12 @@
    $search_str .= sprintf(" %s {%d}\r\n%s", $sub, strlen($search), $search);
}
$search_str = trim($search_str);
$search_str  = trim($search_str);
$sort_column = rcmail_sort_column();
// execute IMAP search
if ($search_str)
  $RCMAIL->storage->search($mbox, $search_str, $imap_charset, $_SESSION['sort_col']);
  $RCMAIL->storage->search($mbox, $search_str, $imap_charset, $sort_column);
// save search results in session
if (!is_array($_SESSION['search']))
@@ -124,9 +125,8 @@
// Get the headers
$result_h = $RCMAIL->storage->list_messages($mbox, 1, $_SESSION['sort_col'], $_SESSION['sort_order']);
$result_h = $RCMAIL->storage->list_messages($mbox, 1, $sort_column, rcmail_sort_order());
$count = $RCMAIL->storage->count($mbox, $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL');
// Make sure we got the headers
if (!empty($result_h)) {