Pārlūkot izejas kodu

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

stekkel 22 gadi atpakaļ
vecāks
revīzija
9ffa2585f1
1 mainītis faili ar 6 papildinājumiem un 3 dzēšanām
  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 = "";