Fix IMAP parsing to properly match Non-FETCH reponses.
authorindiri69 <indiri69@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 16 Mar 2002 04:19:20 +0000 (04:19 +0000)
committerindiri69 <indiri69@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 16 Mar 2002 04:19:20 +0000 (04:19 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2588 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mime.php

index 194f82f..d19d6e0 100644 (file)
@@ -382,8 +382,8 @@ function mime_fetch_body($imap_stream, $id, $ent_id ) {
     $data = sqimap_run_command ($imap_stream, $cmd, true, $response, $message);
 
     do {
-        $topline = array_shift( $data );
-    } while( $topline && $topline == '*' && !preg_match( '/\\* [0-9] FETCH.*/i', $topline )) ;
+        $topline = trim(array_shift( $data ));
+    } while( $topline && $topline[0] == '*' && !preg_match( '/\* [0-9]+ FETCH.*/i', $topline )) ;
     $wholemessage = implode('', $data);
     if (ereg('\\{([^\\}]*)\\}', $topline, $regs)) {