소스 검색

fixed bug in mailbox_exists for shane

Luke Ehresman 25 년 전
부모
커밋
373c24d0e1
1개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 6
      functions/imap_mailbox.php

+ 6 - 6
functions/imap_mailbox.php

@@ -19,13 +19,13 @@
     **  Checks whether or not the specified mailbox exists 
     ******************************************************************************/
    function sqimap_mailbox_exists ($imap_stream, $mailbox) {
-      $boxes = sqimap_mailbox_list ($imap_stream);
-      $found = false;
-      for ($i = 0; $i < count ($boxes); $i++) {
-         if ($boxes[$i]["unformatted"] == $mailbox)
-            $found = true;
+      fputs ($imap_stream, "a001 LIST \"\" \"$mailbox\"\r\n");
+      $mbx = sqimap_read_data($imap_stream, "a001", true, $response, $message);
+      if (ereg ("$mailbox", $mbx[0])) {
+         return true;
+      } else {
+         return false;
       }
-      return $found;
    }