diff --git a/library/Icinga/Protocol/Ldap/LdapConnection.php b/library/Icinga/Protocol/Ldap/LdapConnection.php index 2e97b8c9b..38440e029 100644 --- a/library/Icinga/Protocol/Ldap/LdapConnection.php +++ b/library/Icinga/Protocol/Ldap/LdapConnection.php @@ -703,8 +703,7 @@ class LdapConnection implements Selectable, Inspectable array_flip($fields) ); } - } while ( - (! $serverSorting || $limit === 0 || $limit !== count($entries)) + } while ((! $serverSorting || $limit === 0 || $limit !== count($entries)) && ($entry = ldap_next_entry($ds, $entry)) );