diff --git a/classes/rawemailmessage.class.inc.php b/classes/rawemailmessage.class.inc.php index 774d932..1b1a951 100644 --- a/classes/rawemailmessage.class.inc.php +++ b/classes/rawemailmessage.class.inc.php @@ -235,6 +235,11 @@ public function GetAttachments(&$aAttachments = null, $aPart = null, &$index = 1 { $sFileName = $aMatches[1]; } + // Note: Since the RFC2045-compliant regex above has different levels of matches, + // because of the use of capture groups, indexing into the results with + // $aMatches[1] sometimes returns the filename with quotes, but sometimes not. + // For that reason (and for the sake of codesimplicity) we strip all quotes + // from filenames here and will be fine. $sFileName = str_replace("'", '', $sFileName); $sFileName = str_replace('"', '', $sFileName); if (empty($sFileName))