浏览代码

While getting data from a stream it is possible to reach the end, so we should check it to avoid an infinite loop.

philippe_mingo 24 年之前
父节点
当前提交
ff34119940
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      functions/mime.php

+ 1 - 1
functions/mime.php

@@ -64,7 +64,7 @@
       $read = fgets ($imap_stream, 10000);
       $response = substr($read, 0, 4);
       $bodystructure = "";
-      while ($response != "a001") {
+      while ($response != 'a001' ) && !feof( $imap_stream ) {
          $bodystructure .= $read;
          $read = fgets ($imap_stream, 10000);
          $response = substr($read, 0, 4);