Merge pull request #60 from asig2016/fix_count

Fixed, PHP Warning: count(): Parameter must be an array or an object …
This commit is contained in:
Ralf Becker 2019-03-03 15:09:14 +01:00 committed by GitHub
commit 36e9984be3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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']);
//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']);
@ -1337,7 +1337,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;

View File

@ -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 (".