From 6723329910fad9b7cef45611d0bf61eaf6123071 Mon Sep 17 00:00:00 2001 From: Pablo Zmdl Date: Thu, 20 Jun 2024 10:59:35 +0200 Subject: [PATCH] Consider all mime-parts to check if message is empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- program/actions/mail/show.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/program/actions/mail/show.php b/program/actions/mail/show.php index a2105e5bc42..b5e1de64afc 100644 --- a/program/actions/mail/show.php +++ b/program/actions/mail/show.php @@ -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 ''; }