Skip to content

Commit

Permalink
Fixed, PHP Warning: count(): Parameter must be an array or an object …
Browse files Browse the repository at this point in the history
…that implements Countable in
  • Loading branch information
asig2016 authored and ralfbecker committed Mar 3, 2019
1 parent fb31d08 commit b328bf1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions admin/inc/class.admin_mail.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ public function edit(array $content=null, $msg='', $msg_type='success')
$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']);
Expand Down Expand Up @@ -1334,7 +1334,7 @@ public function edit(array $content=null, $msg='', $msg_type='success')
}
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;
Expand Down
2 changes: 1 addition & 1 deletion api/src/Contacts/Sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ function &search($criteria,$only_keys=True,$order_by='',$extra_cols='',$wildcard
$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 (".
Expand Down

0 comments on commit b328bf1

Please sign in to comment.