Browse Source

fix for BAD response during thread view. The problem was the availability of
untagged OK responses before the actual thread response

stekkel 22 năm trước cách đây
mục cha
commit
9ffa2585f1
1 tập tin đã thay đổi với 6 bổ sung3 xóa
  1. 6 3
      functions/imap_messages.php

+ 6 - 3
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 = "";