Fix that Icinga\Protocol\Ldap\Connection does not correctly apply limits

This commit is contained in:
Johannes Meyer 2015-01-29 17:07:58 +01:00
parent 97cc37b99c
commit 9ff0bbcfc0
1 changed files with 3 additions and 2 deletions

View File

@ -285,8 +285,9 @@ class Connection
$entry = ldap_first_entry($this->ds, $results);
while ($entry) {
$count++;
if (($offset === null || $offset <= $count)
&& ($limit === null || ($offset + $limit) > $count)
if (
($offset === null || $offset <= $count)
&& ($limit === null || $limit > count($entries))
) {
$entries[ldap_get_dn($this->ds, $entry)] = $this->cleanupAttributes(
ldap_get_attributes($this->ds, $entry)