From b328bf151a22ffda653de5b09a216384f1f0887b Mon Sep 17 00:00:00 2001 From: Alexandros Sigalas Date: Sun, 3 Mar 2019 15:39:57 +0200 Subject: [PATCH] Fixed, PHP Warning: count(): Parameter must be an array or an object that implements Countable in --- admin/inc/class.admin_mail.inc.php | 4 ++-- api/src/Contacts/Sql.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/inc/class.admin_mail.inc.php b/admin/inc/class.admin_mail.inc.php index ccfc613a01..9812f99477 100644 --- a/admin/inc/class.admin_mail.inc.php +++ b/admin/inc/class.admin_mail.inc.php @@ -840,7 +840,7 @@ class admin_mail $content['acc_id'] = key($content['accounts']); //error_log(__METHOD__.__LINE__.'.'.array2string($content['acc_id'])); // test if the "to be selected" acccount is imap or not - if (count($content['accounts'])>1 && Mail\Account::is_multiple($content['acc_id'])) + if (is_array($content['accounts']) && count($content['accounts'])>1 && Mail\Account::is_multiple($content['acc_id'])) { try { $account = Mail\Account::read($content['acc_id'], $content['called_for']); @@ -1334,7 +1334,7 @@ class admin_mail } Framework::message($msg ? $msg : (string)$_GET['msg'], $msg_type); - if (count($content['account_id']) > 1) + if (is_array($content['account_id']) && count($content['account_id']) > 1) { $tpl->setElementAttribute('account_id', 'multiple', true); $readonlys['button[multiple]'] = true; diff --git a/api/src/Contacts/Sql.php b/api/src/Contacts/Sql.php index 4f7ce7ed54..8954b28a38 100644 --- a/api/src/Contacts/Sql.php +++ b/api/src/Contacts/Sql.php @@ -532,7 +532,7 @@ class Sql extends Api\Storage $filter['private'] = 0; } // if multiple addressbooks (incl. current owner) are searched, we need full acl filter - elseif(count($filter['owner']) > 1) + elseif(is_array($filter['owner']) && count($filter['owner']) > 1) { $filter[] = "($this->table_name.contact_owner=".(int)$GLOBALS['egw_info']['user']['account_id']. " OR contact_private=0 AND $this->table_name.contact_owner IN (".