X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fimap_mailbox.php;h=67bf3e4741b675d08f286e079338966a4c520412;hb=587ec647ab27414babdc9d7965365f579bcf6074;hp=0a376ce2318856fc07ef73b28dfbf7eebd78d633;hpb=3027826accdf2a81f7dc39e279e67a6b94214170;p=squirrelmail.git diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index 0a376ce2..67bf3e47 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -42,7 +42,7 @@ class mailboxes { } else { $no_select_mbx->mailboxname_full = $ary[$i]; } - $no_select_mbx->mailboxname_sub = imap_utf7_decode_local($ary[$i]); + $no_select_mbx->mailboxname_sub = $ary[$i]; $no_select_mbx->is_noselect = true; $mbx_parent->mbxs[] = $no_select_mbx; $i--; @@ -814,6 +814,7 @@ function sqimap_fill_mailbox_tree($mbx_ary, $mbxs=false) { $trail_del = false; $start = 0; + if (isset($folder_prefix) && ($folder_prefix != '')) { $start = substr_count($folder_prefix,$delimiter); if (strrpos($folder_prefix, $delimiter) == (strlen($folder_prefix)-1)) { @@ -863,16 +864,27 @@ 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 = imap_utf7_decode_local(substr($mbx_ary[$i]['mbx'],$r_del_pos+1)); + $mbx->mailboxname_sub = substr($mbx_ary[$i]['mbx'],$r_del_pos+1); } else { /* mailbox is root folder */ - $mbx->mailboxname_sub = imap_utf7_decode_local($mbx_ary[$i]['mbx']); + $mbx->mailboxname_sub = $mbx_ary[$i]['mbx']; } $mbx->mailboxname_full = $mbx_ary[$i]['mbx']; $mailboxes->addMbx($mbx, $delimiter, $start, $list_special_folders_first); } } + sqimap_utf7_decode_mbx_tree($mailboxes); return $mailboxes; } +function sqimap_utf7_decode_mbx_tree(&$mbx_tree) { + $mbx_tree->mailboxname_sub=imap_utf7_decode_local($mbx_tree->mailboxname_sub); + if ($mbx_tree->mbxs) { + $iCnt = count($mbx_tree->mbxs); + for ($i=0;$i<$iCnt;++$i) { + $mbxs_tree->mbxs[$i] = sqimap_utf7_decode_mbx_tree($mbx_tree->mbxs[$i]); + } + } +} + ?>