$has_inbox = false;
for ($i = 0, $cnt = count($lsub_ary); $i < $cnt; $i++) {
- if (preg_match("/^\*\s+LSUB\s+\((.*)\)\s+\"(.{1})\"\s+\"INBOX\".*$/",$lsub_ary[$i])) {
+ if (preg_match("/\/^\*\s+LSUB\s(.*)[\"]?INBOX[\"]?.*$/",$lsub_ary[$i])) {
$has_inbox = true;
break;
}
if ($has_inbox == false) {
$lsub_ibx = sqimap_run_command( $imap_stream, "LSUB \"\" \"INBOX\"", true, $response, $message );
if (isset($lsub_ibx[0])) {
- if (preg_match("/^\*\s+LSUB\s+\((.*)\)\s+\"(.{1})\"\s+\"INBOX\".*$/",$lsub_ibx[0])) {
+ if (preg_match("/^\*\s+LSUB\s+(.*)[\"]?INBOX[\"]?.*$/",$lsub_ibx[0])) {
$lsub_ary[] = $lsub_ibx[0];
}
}
}
}
}
+
$boxesnew = sqimap_fill_mailbox_tree($sorted_lsub_ary);
return $boxesnew;
}