From ed86f5bfae2f447e0e95a6c2a0c9c4d8a896cc67 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 6 Oct 2021 11:38:54 +0200 Subject: [PATCH] PHP8: fix error Illegal offset typePHP, happens while moving mail from one account to another --- api/src/Mail.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/src/Mail.php b/api/src/Mail.php index 3da91ce9ea..1731ecd4a9 100644 --- a/api/src/Mail.php +++ b/api/src/Mail.php @@ -4210,7 +4210,10 @@ class Mail } if ($folder instanceof Horde_Imap_Client_Mailbox) $_folder = $folder->utf8; //error_log(__METHOD__.__LINE__.'#'.$this->icServer->ImapServerId.'#'.array2string($_folder).'#'); - self::$folderStatusCache[$this->icServer->ImapServerId][(!empty($_folder)?$_folder: $this->sessionData['mailbox'])]['uidValidity'] = 0; + if (isset(self::$folderStatusCache[$this->icServer->ImapServerId][($_folder??$this->sessionData['mailbox'])]['uidValidity'])) + { + self::$folderStatusCache[$this->icServer->ImapServerId][($_folder??$this->sessionData['mailbox'])]['uidValidity'] = 0; + } //error_log(__METHOD__.' ('.__LINE__.') '.'->' .$_flag." ".array2string($_messageUID).",".($_folder?$_folder:$this->sessionData['mailbox'])); return true; // as we do not catch/examine setFlags returnValue