فهرست منبع

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

stekkel 22 سال پیش
والد
کامیت
9ffa2585f1
1فایلهای تغییر یافته به همراه6 افزوده شده و 3 حذف شده
  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 = "";