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

pipe: Honor inline bodies as valid message

Previously, if a message had a Content-Disposition header, then it could not
be considered as the body of the message.
parent 07fec4c4
Branches
Tags
No related merge requests found
...@@ -246,7 +246,10 @@ class Mail_Parse { ...@@ -246,7 +246,10 @@ class Mail_Parse {
if($struct && !$struct->parts) { if($struct && !$struct->parts) {
$ctype = @strtolower($struct->ctype_primary.'/'.$struct->ctype_secondary); $ctype = @strtolower($struct->ctype_primary.'/'.$struct->ctype_secondary);
if($ctype && strcasecmp($ctype,$ctypepart)==0) { if ($struct->disposition
&& (strcasecmp($struct->disposition, 'inline') !== 0))
return '';
if ($ctype && strcasecmp($ctype,$ctypepart)==0) {
$content = $struct->body; $content = $struct->body;
//Encode to desired encoding - ONLY if charset is known?? //Encode to desired encoding - ONLY if charset is known??
if (isset($struct->ctype_parameters['charset'])) if (isset($struct->ctype_parameters['charset']))
...@@ -260,8 +263,7 @@ class Mail_Parse { ...@@ -260,8 +263,7 @@ class Mail_Parse {
$data=''; $data='';
if($struct && $struct->parts && $recurse) { if($struct && $struct->parts && $recurse) {
foreach($struct->parts as $i=>$part) { foreach($struct->parts as $i=>$part) {
if($part && !$part->disposition if($part && ($text=$this->getPart($part,$ctypepart,$recurse - 1)))
&& ($text=$this->getPart($part,$ctypepart,$recurse - 1)))
$data.=$text; $data.=$text;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment