From ea7ff11121c27c813a334e817b88579bf0694d9d Mon Sep 17 00:00:00 2001 From: indiri69 Date: Fri, 8 Mar 2002 21:07:49 +0000 Subject: [PATCH] Fixed a problem with sqimap_unseen_messages where some versions of UW Imap will send 2 lines of response on a STATUS mailbox (UNSEEN) when the last EXAMINE was on the same mailbox. This kept the INBOX from displaying the number of unread messages. This seems like valid behaviour to me, but UW IMAP doesn't like it depending on how it's been compiled. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2551 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_general.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/functions/imap_general.php b/functions/imap_general.php index 7c17736b..d8bad015 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -429,7 +429,13 @@ function sqimap_find_displayable_name ($string) { function sqimap_unseen_messages ($imap_stream, $mailbox) { //fputs ($imap_stream, sqimap_session_id() . " SEARCH UNSEEN NOT DELETED\r\n"); $read_ary = sqimap_run_command ($imap_stream, "STATUS \"$mailbox\" (UNSEEN)", true, $result, $message); - ereg("UNSEEN ([0-9]+)", $read_ary[0], $regs); + $i = 0; + while (isset($read_ary[$i])) { + if (ereg("UNSEEN ([0-9]+)", $read_ary[$i], $regs)) { + break; + } + $i++; + } return $regs[1]; } -- 2.25.1