Browse Source

This makes more sense to me, and has been shown not to break anything, and while the other method should probably be fixed at some point, I think this is good for now.

Erin Schnabel 22 years ago
parent
commit
d0bc2d45e0
1 changed files with 5 additions and 1 deletions
  1. 5 1
      functions/imap_general.php

+ 5 - 1
functions/imap_general.php

@@ -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;