From be9aacaa5296dfca63fb3a01c2dc52538d1546aa Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Sat, 17 Nov 2012 12:31:31 -0500
Subject: [PATCH] Bring back lost localization for the about page

---
 program/include/rcube_result_thread.php |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/program/include/rcube_result_thread.php b/program/include/rcube_result_thread.php
index 214aec2..c609bdc 100644
--- a/program/include/rcube_result_thread.php
+++ b/program/include/rcube_result_thread.php
@@ -24,6 +24,9 @@
 
 /**
  * Class for accessing IMAP's THREAD result
+ *
+ * @package    Framework
+ * @subpackage Storage
  */
 class rcube_result_thread
 {
@@ -61,6 +64,8 @@
         // ...skip unilateral untagged server responses
         for ($i=0, $len=count($data); $i<$len; $i++) {
             if (preg_match('/^ THREAD/i', $data[$i])) {
+                // valid response, initialize raw_data for is_error()
+                $this->raw_data = '';
                 $data[$i] = substr($data[$i], 7);
                 break;
             }
@@ -473,16 +478,18 @@
             $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);

--
Gitblit v1.9.1