From 5a0c449c9cacbbb76d2884dc5ad01a37acab4847 Mon Sep 17 00:00:00 2001 From: stekkel Date: Fri, 21 May 2004 13:03:42 +0000 Subject: [PATCH] fix for non server side sorting on internal date 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/imap_messages.php b/functions/imap_messages.php index 6364be49..4edca163 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -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); -- 2.25.1