While getting data from a stream it is possible to reach the end, so we should check it to avoid an infinite loop.
This commit is contained in:
parent
955e23c710
commit
ff34119940
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@
|
||||||
$read = fgets ($imap_stream, 10000);
|
$read = fgets ($imap_stream, 10000);
|
||||||
$response = substr($read, 0, 4);
|
$response = substr($read, 0, 4);
|
||||||
$bodystructure = "";
|
$bodystructure = "";
|
||||||
while ($response != "a001") {
|
while ($response != 'a001' ) && !feof( $imap_stream ) {
|
||||||
$bodystructure .= $read;
|
$bodystructure .= $read;
|
||||||
$read = fgets ($imap_stream, 10000);
|
$read = fgets ($imap_stream, 10000);
|
||||||
$response = substr($read, 0, 4);
|
$response = substr($read, 0, 4);
|
||||||
|
|
Loading…
Add table
Reference in a new issue