Sfoglia il codice sorgente

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

stekkel 22 anni fa
parent
commit
9ffa2585f1
1 ha cambiato i file con 6 aggiunte e 3 eliminazioni
  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 = "";