Fixed, PHP Warning: count(): Parameter must be an array or an object that implements Countable in

This commit is contained in:
Alexandros Sigalas 2019-03-03 15:39:57 +02:00
parent 85dfa80d6a
commit 2e55e7901d
2 changed files with 3 additions and 3 deletions

View File

@ -843,7 +843,7 @@ class admin_mail
list($content['acc_id']) = each($content['accounts']); list($content['acc_id']) = each($content['accounts']);
//error_log(__METHOD__.__LINE__.'.'.array2string($content['acc_id'])); //error_log(__METHOD__.__LINE__.'.'.array2string($content['acc_id']));
// test if the "to be selected" acccount is imap or not // 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 { try {
$account = Mail\Account::read($content['acc_id'], $content['called_for']); $account = Mail\Account::read($content['acc_id'], $content['called_for']);
@ -1337,7 +1337,7 @@ class admin_mail
} }
Framework::message($msg ? $msg : (string)$_GET['msg'], $msg_type); 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); $tpl->setElementAttribute('account_id', 'multiple', true);
$readonlys['button[multiple]'] = true; $readonlys['button[multiple]'] = true;

View File

@ -532,7 +532,7 @@ class Sql extends Api\Storage
$filter['private'] = 0; $filter['private'] = 0;
} }
// if multiple addressbooks (incl. current owner) are searched, we need full acl filter // 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']. $filter[] = "($this->table_name.contact_owner=".(int)$GLOBALS['egw_info']['user']['account_id'].
" OR contact_private=0 AND $this->table_name.contact_owner IN (". " OR contact_private=0 AND $this->table_name.contact_owner IN (".