From 542192ce6e7a60cf8897b9fa0e28af18a71bedd9 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 7 Oct 2021 12:37:10 +0200 Subject: [PATCH] fix PHP 8.0 error Illegal string offset folder object need to be cast to string (folder name) as objects are not allowed as array keys --- api/src/Mail.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/Mail.php b/api/src/Mail.php index cc8dc088ad..4e4d56d44f 100644 --- a/api/src/Mail.php +++ b/api/src/Mail.php @@ -5589,10 +5589,10 @@ class Mail if (empty($_folder)) $_folder = $this->sessionData['mailbox']?: $this->icServer->getCurrentMailbox(); $_uid = !(is_object($_uid) || is_array($_uid)) ? (array)$_uid : $_uid; - if (!$_stream && isset($rawBody[$this->icServer->ImapServerId][$_folder][$_uid[0]][(empty($_partID)?'NIL':$_partID)])) + if (!$_stream && isset($rawBody[$this->icServer->ImapServerId][(string)$_folder][$_uid[0]][(empty($_partID)?'NIL':$_partID)])) { //error_log(__METHOD__.' ('.__LINE__.') '." Using Cache for raw Body $_uid, $_partID in Folder $_folder"); - return $rawBody[$this->icServer->ImapServerId][$_folder][$_uid[0]][(empty($_partID)?'NIL':$_partID)]; + return $rawBody[$this->icServer->ImapServerId][(string)$_folder][$_uid[0]][(empty($_partID)?'NIL':$_partID)]; } $uidsToFetch = new Horde_Imap_Client_Ids(); @@ -5629,7 +5629,7 @@ class Mail if (!$_stream) { //error_log(__METHOD__.' ('.__LINE__.') '."[{$this->icServer->ImapServerId}][$_folder][$_uid][".(empty($_partID)?'NIL':$_partID)."]"); - $rawBody[$this->icServer->ImapServerId][$_folder][$_uid[0]][(empty($_partID)?'NIL':$_partID)] = $body; + $rawBody[$this->icServer->ImapServerId][(string)$_folder][$_uid[0]][(empty($_partID)?'NIL':$_partID)] = $body; } return $body; }