diff options
author | Aleksander Machniak <alec@alec.pl> | 2012-10-11 08:47:40 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2012-10-11 08:47:40 +0200 |
commit | 485f23b85970e8b3fb559e28a763915f41d4e0d6 (patch) | |
tree | ef172c0c5a0bc5dd7f25f50573a3d1b46744b51c | |
parent | 9de86aaaa9db6ac3ae36a0ad13fa82a0d02938a1 (diff) |
Fix threaded list sorting on PHP < 5.2.9 (#1488748)
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | program/include/rcube_result_thread.php | 10 |
2 files changed, 7 insertions, 4 deletions
@@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix threaded list sorting on PHP < 5.2.9 (#1488748) - Plugin API: Add 'email_list' argument for identities data in user_create hook - Integrated zipdownload plugin to download all attachments (#1445509) - Fix HTML special characters handling in message list/header display (#1488523) diff --git a/program/include/rcube_result_thread.php b/program/include/rcube_result_thread.php index 09fa46522..b2325a499 100644 --- a/program/include/rcube_result_thread.php +++ b/program/include/rcube_result_thread.php @@ -475,16 +475,18 @@ class rcube_result_thread $items = explode(self::SEPARATOR_ITEM, $elem); $root = (int) array_shift($items); - $result[$elem] = $elem; - foreach ($items as $item) { - list($lv, $id) = explode(self::SEPARATOR_LEVEL, $item); + if ($root) { + $result[$root] = $root; + foreach ($items as $item) { + list($lv, $id) = explode(self::SEPARATOR_LEVEL, $item); $result[$id] = $root; + } } } // get only unique roots $result = array_filter($result); // make sure there are no nulls - $result = array_unique($result, SORT_NUMERIC); + $result = array_unique($result); // Re-sort raw data $result = array_fill_keys($result, null); |