Просмотр исходного кода

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

stekkel 22 лет назад
Родитель
Сommit
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 = "";