diff --git a/webui/model/search/message.php b/webui/model/search/message.php index 4d132ea8..1bd73450 100644 --- a/webui/model/search/message.php +++ b/webui/model/search/message.php @@ -180,17 +180,19 @@ class ModelSearchMessage extends Model { 'text/html' => '' ); - for($i=0; $imessage['text/html'] .= $purifier->purify($body); + if($parts[$i]['headers']['content-type']['type'] == 'text/html') { + $this->message['text/html'] .= $purifier->purify($body); + } + else { + $this->message['text/plain'] .= $body; + } } - else { - $this->message['text/plain'] .= $body; - } - + } else { + $this->message_array[CONST_TEXTPLAIN] = 'EMPTY_MESSAGE_BODY'; } return array('from' => $from,