Added error handling to $parts array iteration

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2023-09-27 18:51:26 +02:00
parent 553ebb4f95
commit 1ca4d3b8c3

View File

@ -180,8 +180,8 @@ class ModelSearchMessage extends Model {
'text/html' => ''
);
if(is_array($parts)) {
for($i=0; $i<count($parts); $i++) {
$body = Piler_Mime_Decode::fixMimeBodyPart($parts[$i]['headers'], $parts[$i]['body']);
if($parts[$i]['headers']['content-type']['type'] == 'text/html') {
@ -190,7 +190,9 @@ class ModelSearchMessage extends Model {
else {
$this->message['text/plain'] .= $body;
}
}
} else {
$this->message_array[CONST_TEXTPLAIN] = 'EMPTY_MESSAGE_BODY';
}
return array('from' => $from,