summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2018-11-24 22:06:45 +0100
committerDaniel Kesselberg <mail@danielkesselberg.de>2018-11-24 22:06:45 +0100
commitd17b32afd713f9f94ea24eba2ba7a753b3270e44 (patch)
treef211134b8951a0bb1f01c9fe18d53a9185ceed4c /apps/user_ldap/lib
parentea17e962bf480b74a492bb525d91b8df43a83b95 (diff)
downloadnextcloud-server-d17b32afd713f9f94ea24eba2ba7a753b3270e44.tar.gz
nextcloud-server-d17b32afd713f9f94ea24eba2ba7a753b3270e44.zip
Fix count on string
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r--apps/user_ldap/lib/Access.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index fb2582e8266..c5075a033b6 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -879,7 +879,7 @@ class Access extends LDAPUtility {
});
}
$this->batchApplyUserAttributes($recordsToUpdate);
- return $this->fetchList($ldapRecords, count($attr) > 1);
+ return $this->fetchList($ldapRecords, $this->manyAttributes($attr));
}
/**
@@ -922,7 +922,7 @@ class Access extends LDAPUtility {
* @return array
*/
public function fetchListOfGroups($filter, $attr, $limit = null, $offset = null) {
- return $this->fetchList($this->searchGroups($filter, $attr, $limit, $offset), count($attr) > 1);
+ return $this->fetchList($this->searchGroups($filter, $attr, $limit, $offset), $this->manyAttributes($attr));
}
/**
@@ -2011,4 +2011,17 @@ class Access extends LDAPUtility {
return $pagedSearchOK;
}
+ /**
+ * Is more than one $attr used for search?
+ *
+ * @param string|string[]|null $attr
+ * @return bool
+ */
+ private function manyAttributes($attr) {
+ if (\is_array($attr)) {
+ return \count($attr) > 1;
+ }
+ return false;
+ }
+
}