Skip to content

Commit

Permalink
Consider all mime-parts to check if message is empty
Browse files Browse the repository at this point in the history
Previously only `parts` and `body` were checked, so mime-parts that were
classified into `attachments` and `inline_parts` didn't count – thus
messages that contained only those parts were shown blank.
  • Loading branch information
pabzm committed Jun 20, 2024
1 parent dd29cf7 commit 6723329
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion program/actions/mail/show.php
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,10 @@ public static function message_full_headers($attrib)
*/
public static function message_body($attrib)
{
if (empty(self::$MESSAGE) || (empty(self::$MESSAGE->parts) && empty(self::$MESSAGE->body))) {
// Exit early if there's no content to be shown anyway.
// `mime_parts` also includes a message's body, even if it originally
// was the only part of the message.
if (empty(self::$MESSAGE) || empty(self::$MESSAGE->mime_parts)) {
return '';
}

Expand Down

0 comments on commit 6723329

Please sign in to comment.