Fix count on string
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
parent
5fc0565695
commit
375ece362d
|
@ -880,7 +880,7 @@ class Access extends LDAPUtility implements IUserTools {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$this->batchApplyUserAttributes($recordsToUpdate);
|
$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
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function fetchListOfGroups($filter, $attr, $limit = null, $offset = null) {
|
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;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue