* Noticed that mime_match_parentheses() didn't work when a string had
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 9 Feb 2001 16:12:54 +0000 (16:12 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 9 Feb 2001 16:12:54 +0000 (16:12 +0000)
  quotes in it.  The string (a " quote) returned by the IMAP server
  would look like "a \" quote", so needed to check for that.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1090 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mime.php

index 0731f7b..4c1930b 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) {