diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-11-27 14:14:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-27 14:14:24 +0100 |
commit | 95857a81cf5da88392b0abe7308e3e0b5299a056 (patch) | |
tree | 0f3614f3504202b2fb7b74c6b341d8bced8bd6db | |
parent | ebd6231559654352a4c35e50763abacdf0aff541 (diff) | |
parent | 6ce849f7b8b5388ee649b2f819cb741cd5c40dde (diff) | |
download | nextcloud-server-95857a81cf5da88392b0abe7308e3e0b5299a056.tar.gz nextcloud-server-95857a81cf5da88392b0abe7308e3e0b5299a056.zip |
Merge pull request #12650 from nextcloud/bugfix/12614/count-on-string
Fix count on string
-rw-r--r-- | apps/user_ldap/lib/Access.php | 17 |
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..82947bd6868 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): bool { + if (\is_array($attr)) { + return \count($attr) > 1; + } + return false; + } + } |