From 6880e085f94595cae19ee849330e289b0288022e Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 17 Oct 2023 20:02:30 +0200 Subject: [PATCH] Fix PHP8 fatal error when parsing a malformed BODYSTRUCTURE (#9171) --- CHANGELOG.md | 1 + program/lib/Roundcube/rcube_imap.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc71f0c1700..a61d7d5f11a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ - Password: Add ldap_samba_ad driver (#8525) - Password: Allow LDAP access using LDAP URI and SASL binding (#8402) - Fix potential HTTP protocol version mismatch (#8982) +- Fix PHP8 fatal error when parsing a malformed BODYSTRUCTURE (#9171) ## Release 1.6.4 diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php index 31c64b2206b..0d70c38a017 100644 --- a/program/lib/Roundcube/rcube_imap.php +++ b/program/lib/Roundcube/rcube_imap.php @@ -2166,7 +2166,7 @@ protected function structure_part($part, $count = 0, $parent = '', $mime_headers } // read content encoding - if (!empty($part[5])) { + if (!empty($part[5]) && !is_array($part[5])) { $struct->encoding = strtolower($part[5]); $struct->headers['content-transfer-encoding'] = $struct->encoding; }