From 5efb632b7a3a2fa76cf3ee76df650f1f2317a206 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Fri, 25 Nov 2016 09:40:34 +0100 Subject: [PATCH] Fix count() usage. Detected by PHP 7.2. count() should only be passed arrays and Countables. --- lib/Horde/Kolab/Server/Ldap/Changes.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Horde/Kolab/Server/Ldap/Changes.php b/lib/Horde/Kolab/Server/Ldap/Changes.php index 84a6ea0..348631f 100644 --- a/lib/Horde/Kolab/Server/Ldap/Changes.php +++ b/lib/Horde/Kolab/Server/Ldap/Changes.php @@ -77,9 +77,8 @@ public function getChangeset() $cs['delete'][] = $attribute; continue; } - if (count($new[$attribute]) == 1 - && count($old[$attribute]) == 1 - ) { + if ((!is_array($new[$attribute]) || count($new[$attribute]) == 1) && + (!is_array($old[$attribute]) || count($old[$attribute]) == 1)) { if ($new[$attribute][0] == $old[$attribute][0]) { continue; } else {