Browse Source

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 năm trước cách đây
mục cha
commit
ff34119940
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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);