fix for BAD response during thread view. The problem was the availability of
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 16 Jul 2003 16:37:44 +0000 (16:37 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 16 Jul 2003 16:37:44 +0000 (16:37 +0000)
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

index 8eec107fc122892204fa5ba135dcba627c2b9746..96ebc7205c1f8ed18d8667dbd6ab474c2c8944bb 100755 (executable)
@@ -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 = "";