Skip to content
Snippets Groups Projects
Commit c57c22a5 authored by Jared Hancock's avatar Jared Hancock
Browse files

mailparse: Fix incorrect parsing of some multipart messages

This patch drops the content after the last boundary in a multi-part message
which prevents it from being considered in some case where the available
content sections are not favorable.

Backport me to v1.9
parent 08a32a4b
Branches
Tags
No related merge requests found
......@@ -529,6 +529,15 @@ class Mail_mimeDecode extends PEAR
if ($input instanceof StringView) {
$parts = $input->split('--' . $boundary);
array_shift($parts);
if (count($parts) > 0
&& $parts[count($parts)-1]->substr(0, 2)->__toString() == '--'
) {
// Drop the last part if it starts with '--' as such would
// be past the end of a multipart section
array_pop($parts);
}
return $parts;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment