* Noticed that mime_match_parentheses() didn't work when a string had
[squirrelmail.git] / functions / mime.php
index 2af69c78fff7b2ed0d551bb31eac5d6f626f6d47..4c1930b728732796ff28ad06312b9a122824d708 100644 (file)
             $pos ++;
             while (substr($structure, $pos, 1) != '"' && 
                $pos < strlen($structure)) {
+              if (substr($structure, $pos, 2) == '\\"')
+                  $pos ++;
+              elseif (substr($structure, $pos, 2) == '\\\\')
+                  $pos ++;
                $pos ++;
             }
          } else if ($char == "(") {
             $pos = mime_match_parenthesis ($pos, $structure);
          }
       }
+      echo "Error decoding mime structure.  Report this as a bug!<br>\n";
+      return $pos;
    }
 
    function mime_fetch_body ($imap_stream, $id, $ent_id) {
       if (($body_message->header->type0 == "text") || 
           ($body_message->header->type0 == "rfc822")) {
    
-         $body = mime_fetch_body ($imap_stream, $id, $ent_num); 
+         $body = mime_fetch_body ($imap_stream, $id, $ent_num);
          $body = decodeBody($body, $body_message->header->encoding);
    
          // If there are other types that shouldn't be formatted, add