Handle article with missing boundary line in message.inc.php.

This commit is contained in:
Retro_Guy 2024-07-25 06:09:57 -07:00
parent 8bc18592b2
commit 71e29dd57c
1 changed files with 7 additions and 2 deletions

View File

@ -49,9 +49,14 @@ function message_parse($rawmessage)
// We have multible bodies, so we split the message into its parts
$boundary = "--" . $message->header->content_type_boundary;
// lets find the first part
while ($rawmessage[$i] != $boundary)
while ($rawmessage[$i] != $boundary) {
if(!$rawmessage[$i]) {
break;
}
$i ++;
}
$i ++;
$i ++;
$part = array();
while ($i <= $count_rawmessage) {
if (($rawmessage[$i] == $boundary) || ($i == $count_rawmessage - 1) || ($rawmessage[$i] == $boundary . '--')) {