} 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--;
$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)) {
$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]);
+ }
+ }
+}
+
?>