fix for non server side sorting on internal date
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 21 May 2004 13:03:42 +0000 (13:03 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 21 May 2004 13:03:42 +0000 (13:03 +0000)
Modified the subject sort to strip out the [mailinglist] entries before we
start sorting.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7508 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php

index 6364be4..4edca16 100755 (executable)
@@ -243,7 +243,7 @@ function get_squirrel_sort ($imap_stream, $sSortField, $reverse = false) {
       case 'SUBJECT':
         array_walk($msgs, create_function('&$v,&$k',
               '$v["SUBJECT"] = strtolower(decodeHeader(trim($v["SUBJECT"])));
-               $v["SUBJECT"] = (preg_match("/^(vedr|sv|re|aw):\s*(.*)$/si", $v["SUBJECT"], $matches)) ?
+               $v["SUBJECT"] = (preg_match("/^(vedr|sv|re|aw|\[\w\]):\s*(.*)$/si", $v["SUBJECT"], $matches)) ?
                                   $matches[2] : $v["SUBJECT"];'));
         foreach ($msgs as $item) {
             $msort["$item[ID]"] = $item['SUBJECT'];
@@ -272,7 +272,7 @@ function get_squirrel_sort ($imap_stream, $sSortField, $reverse = false) {
         //array_walk($msgs, create_function('&$v,$k',
         //    '$v["RFC822.SIZE"] = getTimeStamp(explode(" ",$v["RFC822.SIZE"]));'));
         foreach ($msgs as $item) {
-            $msort[$item['ID']] = $item['SIZE'];
+            $msort[$item['ID']] = $item[$sSortField];
         }
         if ($reverse) {
             arsort($msort,SORT_NUMERIC);