Browse Source

We have to know when there is attachment with size 0 and when there is no size ($size is set to -1 now).

Ondřej Surý 23 years ago
parent
commit
d350b9790e
1 changed files with 3 additions and 3 deletions
  1. 3 3
      functions/imap_general.php

+ 3 - 3
functions/imap_general.php

@@ -56,11 +56,11 @@ $imap_general_debug = false;
                 flush();
             }
 
-            $size = 0;
+            $size = -1;
             $data[] = $read;
             $read = fgets($imap_stream, 9096);
          } else {
-            $size = 0;
+            $size = -1;
          }
          while (1) {
             while (strpos($read, "\n") === false) {
@@ -95,7 +95,7 @@ $imap_general_debug = false;
                $total_size += strlen($read);
             } else {
                if (ereg("^$pre (OK|BAD|NO)(.*)", $read, $regs) ||
-                   ereg("^\\* [0-9]+ FETCH.*", $read, $regs)) {
+                   (($size == -1) && ereg("^\\* [0-9]+ FETCH.*", $read, $regs))) {
                   break;
                } else {
                   $data[] = $read;