From: stekkel Date: Thu, 22 Apr 2004 18:12:39 +0000 (+0000) Subject: Should have done this a long time ago. Rely on the CAPABILITY response and X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=65ba4ebe7e29fef44952780b14ff97891f1da551;hp=7b9fdca94be72d8426811edbc6cf4d18eab36a01 Should have done this a long time ago. Rely on the CAPABILITY response and detect if the SORT extension is supported. If it's supported then use it unless $disable_server_sort is set to true (default false); Courier users with SORT in the capability string and a disabled server sort need to rerun conf.pl and disable the server sort. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7219 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index b7185e0c..7e43bdf1 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -534,7 +534,7 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs, $start_msg, $sort, $color, $show_num, $use_cache, $mode='') { global $msgs, $msort, $auto_expunge, $thread_sort_messages, - $allow_server_sort, $server_sort_order; + $disable_server_sort, $server_sort_order; /* * For some reason, on PHP 4.3+, this being unset, and set in the session causes havoc @@ -550,6 +550,10 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs, $msgs = array(); } + if (!isset(disable_server_sort)) { + $disable_server_sort = false; + } + //$start = microtime(); /* If autoexpunge is turned on, then do it now. */ $mbxresponse = sqimap_mailbox_select($imapConnection, $mailbox); @@ -581,7 +585,7 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs, if ($thread_sort_messages == 1) { $mode = 'thread'; - } elseif ($allow_server_sort == 1) { + } elseif (sqimap_capabilty($imapConnection,'SORT') && !$disable_server_sort == 1) { $mode = 'serversort'; } else { $mode = '';