浏览代码

* Noticed that mime_match_parentheses() didn't work when a string had
quotes in it. The string (a " quote) returned by the IMAP server
would look like "a \" quote", so needed to check for that.

Tyler Akins 24 年之前
父节点
当前提交
094f8dccbe
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      functions/mime.php

+ 6 - 0
functions/mime.php

@@ -361,12 +361,18 @@
             $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) {