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

This commit is contained in:
Ralf Becker 2019-07-31 10:55:46 +02:00
parent 9370dbf116
commit f4840d1d87

View File

@ -350,7 +350,7 @@ class Ldap
{
$to_write = $this->_merge_user($to_write,$data_utf8,!$old);
// make sure multiple email-addresses in the mail attribute "survive"
if (isset($to_write[static::MAIL_ATTR]) && count($old[static::MAIL_ATTR]) > 1)
if (isset($to_write[static::MAIL_ATTR]) && is_array($old[static::MAIL_ATTR]) && count($old[static::MAIL_ATTR]) > 1)
{
$mail = $old[static::MAIL_ATTR];
$mail[0] = $to_write[static::MAIL_ATTR];