Skip to content

Commit

Permalink
Add comment as to why str_replace is now used
Browse files Browse the repository at this point in the history
  • Loading branch information
itomig-martin committed Nov 2, 2022
1 parent 18e4ab4 commit 5067ce1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions classes/rawemailmessage.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 5067ce1

Please sign in to comment.