Partially fixed #511204
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 2 Feb 2002 17:25:35 +0000 (17:25 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 2 Feb 2002 17:25:35 +0000 (17:25 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2344 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_general.php

index a5955e6..12a6c25 100755 (executable)
@@ -69,7 +69,9 @@ function sqimap_read_data_list ($imap_stream, $pre, $handle_errors,
         $data = array();
         $total_size = 0;
         while (strpos($read, "\n") === false) {
-            $read .= fgets($imap_stream, 9096);
+            if(!($read .= fgets($imap_stream, 9096))) {
+                break;
+            }
         }
         
         if (ereg("^\\* [0-9]+ FETCH.*\\{([0-9]+)\\}", $read, $regs)) {
@@ -84,7 +86,9 @@ function sqimap_read_data_list ($imap_stream, $pre, $handle_errors,
         }
         while (1) {
             while (strpos($read, "\n") === false) {
-                $read .= fgets($imap_stream, 9096);
+                if(!($read .= fgets($imap_stream, 9096))) {
+                    break;
+                }
             }
             // If we know the size, no need to look at the end parameters
             if ($size > 0) {