فهرست منبع

* 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) {