mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-07 22:41:59 +01:00
Added error handling to $parts array iteration
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
553ebb4f95
commit
1ca4d3b8c3
@ -180,17 +180,19 @@ class ModelSearchMessage extends Model {
|
||||
'text/html' => ''
|
||||
);
|
||||
|
||||
for($i=0; $i<count($parts); $i++) {
|
||||
if(is_array($parts)) {
|
||||
for($i=0; $i<count($parts); $i++) {
|
||||
$body = Piler_Mime_Decode::fixMimeBodyPart($parts[$i]['headers'], $parts[$i]['body']);
|
||||
|
||||
$body = Piler_Mime_Decode::fixMimeBodyPart($parts[$i]['headers'], $parts[$i]['body']);
|
||||
|
||||
if($parts[$i]['headers']['content-type']['type'] == 'text/html') {
|
||||
$this->message['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,
|
||||
|
Loading…
Reference in New Issue
Block a user