Merge pull request #21 from kidhab/patch-1

Add check for MIME encoded messages
pull/25/head
Lucian Pricop 2022-05-11 13:53:24 +03:00 zatwierdzone przez GitHub
commit e14a83dfcd
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -80,11 +80,15 @@ if ($emails)
$data->title = DECODE_SPECIAL_CHARACTERS ? mb_decode_mimeheader($overview->subject) : $overview->subject;
$data->type = "plain";
$data->order = -time();
$body = $inbox->fetchMessageBody($emails[$j], 1.1);
if ($body == "") {
$body = $inbox->fetchMessageBody($emails[$j], 1);
}
if(count($attachments)) {
$data->attachments = $attNames;
$description = DECODE_SPECIAL_CHARACTERS ? quoted_printable_decode($inbox->fetchMessageBody($emails[$j], 1.1)) : $inbox->fetchMessageBody($emails[$j], 1.1);
$description = DECODE_SPECIAL_CHARACTERS ? quoted_printable_decode($body) : $body;
} else {
$description = DECODE_SPECIAL_CHARACTERS ? quoted_printable_decode($inbox->fetchMessageBody($emails[$j], 1)) : $inbox->fetchMessageBody($emails[$j], 1);
$description = DECODE_SPECIAL_CHARACTERS ? quoted_printable_decode($body) : $body;
}
if($base64encode) {
$description = base64_decode($description);