imap_utf7 decoding of mailboxes (mailbox-tree)
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 18 Jun 2003 20:13:23 +0000 (20:13 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 18 Jun 2003 20:13:23 +0000 (20:13 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5083 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_mailbox.php

index cf6d684dcc8624dedffbdaf124166cf2ac25f68e..80ab398f2e8b25c6afc984bba79c426508c8d597 100755 (executable)
@@ -22,15 +22,16 @@ class mailboxes {
 
     function addMbx($mbx, $delimiter, $start, $specialfirst) {
         $ary = explode($delimiter, $mbx->mailboxname_full);
-        $mbx_parent = &$this;
+        $mbx_parent =$this;
         for ($i = $start, $c = count($ary)-1; $i < $c; $i++) {
-            $mbx_childs = &$mbx_parent->mbxs;
+            $mbx_childs =$mbx_parent->mbxs;
             $found = false;
             if ($mbx_childs) {
                 foreach ($mbx_childs as $key => $parent) {
                     if ($parent->mailboxname_sub == $ary[$i]) {
-                        $mbx_parent = &$mbx_parent->mbxs[$key];
+                        $mbx_parent =$mbx_parent->mbxs[$key];
                         $found = true;
+                        break;
                     }
                 }
             }
@@ -41,7 +42,7 @@ class mailboxes {
                 } else {
                     $no_select_mbx->mailboxname_full = $ary[$i];
                 }
-                $no_select_mbx->mailboxname_sub = $ary[$i];
+                $no_select_mbx->mailboxname_sub = imap_utf7_decode_local($ary[$i]);
                 $no_select_mbx->is_noselect = true;
                 $mbx_parent->mbxs[] = $no_select_mbx;
                 $i--;
@@ -794,7 +795,6 @@ function sqimap_mailbox_tree($imap_stream) {
                 }
             }
         }
-
         $boxesnew = sqimap_fill_mailbox_tree($sorted_lsub_ary);
         return $boxesnew;
     }
@@ -869,9 +869,9 @@ function sqimap_fill_mailbox_tree($mbx_ary, $mbxs=false) {
 
             $r_del_pos = strrpos($mbx_ary[$i]['mbx'], $delimiter);
             if ($r_del_pos) {
-                $mbx->mailboxname_sub = substr($mbx_ary[$i]['mbx'],$r_del_pos+1);
+                $mbx->mailboxname_sub = imap_utf7_decode_local(substr($mbx_ary[$i]['mbx'],$r_del_pos+1));
             } else {   /* mailbox is root folder */
-                $mbx->mailboxname_sub = $mbx_ary[$i]['mbx'];
+                $mbx->mailboxname_sub = imap_utf7_decode_local($mbx_ary[$i]['mbx']);
             }
             $mbx->mailboxname_full = $mbx_ary[$i]['mbx'];