From 0d361b9e4a878e63055aeab12a0dc9e21386501b Mon Sep 17 00:00:00 2001 From: thomascube Date: Mon, 27 Mar 2006 19:06:30 +0000 Subject: Fixed buggy date sorting patch --- program/lib/imap.inc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/program/lib/imap.inc b/program/lib/imap.inc index a9ad91ff7..97286c4ff 100644 --- a/program/lib/imap.inc +++ b/program/lib/imap.inc @@ -39,6 +39,7 @@ - Added BCC and REFERENCE to the list of headers to fetch in iil_C_FetchHeaders() - Leave messageID unchanged in iil_C_FetchHeaders() - Avoid stripslahes in iil_Connect() + - Added patch to iil_SortHeaders() by Richard Green - Removed
from error messages (better for logging) - Removed some debuggers (echo ...) @@ -1411,9 +1412,16 @@ function iil_SortHeaders($a, $field, $flag){ reset($a); while (list($key, $val)=each($a)){ - $data=$a[$key]->$field; - if (is_string($data)) - $data=strtoupper(str_replace($stripArr, "", $data)); + if ($field=="timestamp"){ + $data = @strtotime($val->date); + if ($data == false) + $data = $val->timestamp; + } + else { + $data = $val->$field; + if (is_string($data)) + $data=strtoupper(str_replace($stripArr, "", $data)); + } $index[$key]=$data; } -- cgit v1.2.3