Fix issue #737: web gui not showing body for some emails

Change-Id: Ic9fb3d8306adb89da1a95f8dc39019bf85636f12
Signed-off-by: SJ <sj@acts.hu>
This commit is contained in:
SJ 2016-12-11 14:39:06 +01:00
parent 1b6979669b
commit 1b9e6097d6

View File

@ -273,8 +273,16 @@ class ModelSearchMessage extends Model {
'encoding' => '' 'encoding' => ''
); );
if(isset($mime_parts[$i]['header']['content-type'])) if(isset($mime_parts[$i]['header']['content-type'])) {
$mime['content-type'] = Zend_Mime_Decode::splitContentType($mime_parts[$i]['header']['content-type']); $mime['content-type'] = Zend_Mime_Decode::splitContentType($mime_parts[$i]['header']['content-type']);
}
/*
Fix the mime type for some emails having a single textual body part
without the Content-type header.
*/
else if (count($mime_parts) == 1) {
$mime['content-type']['type'] = 'text/plain';
}
if(in_array($mime['content-type']['type'], array('multipart/mixed', 'multipart/related', 'multipart/alternative'))) if(in_array($mime['content-type']['type'], array('multipart/mixed', 'multipart/related', 'multipart/alternative')))
$this->extract_textuals_from_mime_parts($mime_parts[$i]['header'], $mime_parts[$i]['body'], $mime['content-type']['boundary']); $this->extract_textuals_from_mime_parts($mime_parts[$i]['header'], $mime_parts[$i]['body'], $mime['content-type']['boundary']);