From 9978560b011f42cd8ef3e143f8ae0e13135a5611 Mon Sep 17 00:00:00 2001 From: stekkel Date: Wed, 16 Jul 2003 16:37:44 +0000 Subject: [PATCH] fix for BAD response during thread view. The problem was the availability of untagged OK responses before the actual thread response git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5323 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_messages.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/functions/imap_messages.php b/functions/imap_messages.php index 8eec107f..96ebc720 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -352,9 +352,12 @@ function get_thread_sort ($imap_stream) { $query = "THREAD $sort_type ".strtoupper($default_charset)." ALL"; $thread_test = sqimap_run_command ($imap_stream, $query, true, $response, $message, $uid_support); if (isset($thread_test[0])) { - if (preg_match("/^\* THREAD (.+)$/", $thread_test[0], $regs)) { - $thread_list = trim($regs[1]); - } + for ($i=0,$iCnt=count($thread_test);$i<$iCnt;++$i) { + if (preg_match("/^\* THREAD (.+)$/", $thread_test[0], $regs)) { + $thread_list = trim($regs[1]); + break; + } + } } else { $thread_list = ""; -- 2.25.1