From 2282e1aa4fce594c5bacdb4e9eb4689a25e2aa79 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Thu, 23 Nov 2017 15:12:14 +0100 Subject: [PATCH] LdapConnection: respect a query's limit as expected refs #2765 --- library/Icinga/Protocol/Ldap/LdapConnection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/Protocol/Ldap/LdapConnection.php b/library/Icinga/Protocol/Ldap/LdapConnection.php index 90f4f5ba8..72850af00 100644 --- a/library/Icinga/Protocol/Ldap/LdapConnection.php +++ b/library/Icinga/Protocol/Ldap/LdapConnection.php @@ -767,7 +767,7 @@ class LdapConnection implements Selectable, Inspectable $query, array_values($fields), 0, - $serverSorting && $limit ? $offset + $limit : 0 + ($serverSorting || ! $query->hasOrder()) && $limit ? $offset + $limit : 0 ); if ($results === false) { if (ldap_errno($ds) === self::LDAP_NO_SUCH_OBJECT) {