UW can return a slightly different format for the LSUB when you step outside

the default_folder_prefix area, also they return NIL for the delimiter which
means the previous regex would always fail as it is looking for a 1 char
delimiter between ""
This commit is contained in:
jangliss 2003-06-15 06:52:48 +00:00
parent 9614a8fba3
commit bde60ca9f9

View file

@ -722,7 +722,7 @@ function sqimap_mailbox_tree($imap_stream) {
$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;
}
@ -731,7 +731,7 @@ function sqimap_mailbox_tree($imap_stream) {
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];
}
}
@ -787,6 +787,7 @@ function sqimap_mailbox_tree($imap_stream) {
}
}
}
$boxesnew = sqimap_fill_mailbox_tree($sorted_lsub_ary);
return $boxesnew;
}