Merge pull request #12684 from nextcloud/backport/12650/stable14

[stable14] Fix count on string
This commit is contained in:
Roeland Jago Douma 2018-11-27 16:28:56 +01:00 committed by GitHub
commit 2706bc7df7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 2 deletions

View File

@ -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): bool {
if (\is_array($attr)) {
return \count($attr) > 1;
}
return false;
}
}