Skip to content
Snippets Groups Projects
Unverified Commit 01ff051a authored by Seamus Lee's avatar Seamus Lee Committed by GitHub
Browse files

Merge pull request #14208 from seamuslee001/dev_core_940_5_14

(#940) Fix regression involving Email Processor filing and ".unknown" attachments
parents 273b3410 a7790462
Branches
Tags
No related merge requests found
......@@ -23,3 +23,20 @@ index 3acadc3..06f1e71 100644
/**
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @version //autogentag//
diff --git a/src/parser/interfaces/part_parser.php b/src/parser/interfaces/part_parser.php
index a81378b..6c59e5a 100644
--- a/src/parser/interfaces/part_parser.php
+++ b/src/parser/interfaces/part_parser.php
@@ -168,7 +168,11 @@ abstract class ezcMailPartParser
break;
case 'text':
- if ( ezcMailPartParser::$parseTextAttachmentsAsFiles === true )
+ // dev/core#940 Ensure that emails are not processed as .unknown attachments by checking
+ // for Filename or name in the content-disposition and content-type headers.
+ if ( (ezcMailPartParser::$parseTextAttachmentsAsFiles === true) &&
+ (preg_match('/\s*filename="?([^;"]*);?/i', $headers['Content-Disposition']) ||
+ preg_match( '/\s*name="?([^;"]*);?/i' , $headers['Content-Type']) ) )
{
$bodyParser = new ezcMailFileParser( $mainType, $subType, $headers );
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment