Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2018-11-25 00:06:45 +0300
committerBackportbot <backportbot-noreply@rullzer.com>2018-11-27 16:16:28 +0300
commit375ece362dd971b2781e77eafad1aeb180a6dba0 (patch)
treeb08f93b4d4f9bd99f9110ec012da47e05eb36901 /apps/user_ldap
parent5fc0565695e3b39ddf36f766eed870e574ae5f98 (diff)
Fix count on string
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps/user_ldap')
-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 d615a4241bf..5501dd3d0eb 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -880,7 +880,7 @@ class Access extends LDAPUtility implements IUserTools {
});
}
$this->batchApplyUserAttributes($recordsToUpdate);
- return $this->fetchList($ldapRecords, count($attr) > 1);
+ return $this->fetchList($ldapRecords, $this->manyAttributes($attr));
}
/**
@@ -923,7 +923,7 @@ class Access extends LDAPUtility implements IUserTools {
* @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));
}
/**
@@ -2016,4 +2016,17 @@ class Access extends LDAPUtility implements IUserTools {
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;
+ }
+
}