This makes more sense to me, and has been shown not to break anything, and while...
authorebullient <ebullient@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 9 Jan 2003 01:40:00 +0000 (01:40 +0000)
committerebullient <ebullient@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 9 Jan 2003 01:40:00 +0000 (01:40 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4401 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_general.php

index 17c15a467142248e434a8b815967dd2c03e5f6d1..4a97406fa62cf00b7cf70c288323d160820157e9 100755 (executable)
@@ -80,10 +80,14 @@ function sqimap_fgets($imap_stream) {
     $read = '';
     $buffer = 4096;
     $results = '';
-    while (strpos($read, "\n") === false) {
+    $offset = 0;
+    while (strpos($results, "\r\n", $offset) === false) {
         if (!($read = fgets($imap_stream, $buffer))) {
             break;
         }
+        if ( $results != '' ) {
+            $offset = strlen($results) - 1;
+        }
         $results .= $read;
     }
     return $results;