From 4714f3192ab80a4f9b10b30c27ea491fdaf4866e Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 25 Aug 2021 18:57:50 +0200 Subject: [PATCH] Fix a couple of PHP8 warnings (#8175) --- CHANGELOG.md | 1 + program/lib/Roundcube/rcube_imap.php | 4 ++-- program/lib/Roundcube/rcube_imap_cache.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cccab8e7..e9146fc8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Fix displaying inline images with incorrectly declared content-type (#8158) - Fix so addr-spec with missing closing angle bracket can be parsed (#8164) - Fix handling of spellcheck connection errors (#8172) +- Fix a couple of PHP8 warnings (#8175, #8176) ## Release 1.5-rc diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php index 3439788ac..84e22f678 100644 --- a/program/lib/Roundcube/rcube_imap.php +++ b/program/lib/Roundcube/rcube_imap.php @@ -2185,7 +2185,7 @@ class rcube_imap extends rcube_storage $di += 3; } - if (is_array($part[$di]) && count($part[$di]) == 2) { + if (isset($part[$di]) && is_array($part[$di]) && count($part[$di]) == 2) { $struct->disposition = strtolower($part[$di][0]); if ($struct->disposition && $struct->disposition !== 'inline' && $struct->disposition !== 'attachment') { // RFC2183, Section 2.8 - unrecognized type should be treated as "attachment" @@ -2199,7 +2199,7 @@ class rcube_imap extends rcube_storage } // get message/rfc822's child-parts - if (is_array($part[8]) && $di != 8) { + if (isset($part[8]) && is_array($part[8]) && $di != 8) { $struct->parts = []; for ($i=0, $count=0; $iskip_deleted, (int) $mbox_data['UIDVALIDITY'], (int) $mbox_data['UIDNEXT'], - $modseq ? $modseq : $mbox_data['HIGHESTMODSEQ'], + $modseq ?: (isset($mbox_data['HIGHESTMODSEQ']) ? $mbox_data['HIGHESTMODSEQ'] : ''), ]; $data = implode('@', $data);