From dfebb587eda4f5789382cf2884ee857f6fa784a8 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 14 Nov 2021 10:27:12 +0100 Subject: [PATCH] fix PHP 8.0 TypeError: array_search(): Argument #2 ($haystack) must be of type array, bool given --- mail/inc/class.mail_zpush.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail/inc/class.mail_zpush.inc.php b/mail/inc/class.mail_zpush.inc.php index 067a33c0f7..044b9f1a37 100644 --- a/mail/inc/class.mail_zpush.inc.php +++ b/mail/inc/class.mail_zpush.inc.php @@ -877,7 +877,7 @@ class mail_zpush implements activesync_plugin_write, activesync_plugin_sendmail, $bodypreference = $contentparameters->GetBodyPreference(); /* fmbiete's contribution r1528, ZP-320 */ // fix for z-push bug returning additional bodypreference type 4, even if only 1 is requested and mimessupport = 0 - if (!$mimesupport && ($key = array_search('4', $bodypreference))) unset($bodypreference[$key]); + if (!$mimesupport && $bodypreference !== false && ($key = array_search('4', $bodypreference))) unset($bodypreference[$key]); //$this->debugLevel=4; if (!isset($this->mail)) $this->mail = Mail::getInstance(false,self::$profileID,true,false,true);