Skip to content

Commit

Permalink
Ensure headers are strings, not NULL if not set
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Aug 26, 2024
1 parent 1ba2285 commit 88fd961
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/parser/interfaces/part_parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ static public function createPartParserForHeaders( ezcMailHeadersHolder $headers
break;

case 'text':
if ( ezcMailPartParser::$parseTextAttachmentsAsFiles === true )
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 );
}
Expand Down

0 comments on commit 88fd961

Please sign in to comment.