diff --git a/library/Icinga/Protocol/Ldap/Connection.php b/library/Icinga/Protocol/Ldap/Connection.php index b0bf1f281..e340efc25 100644 --- a/library/Icinga/Protocol/Ldap/Connection.php +++ b/library/Icinga/Protocol/Ldap/Connection.php @@ -320,7 +320,7 @@ class Connection protected function runQuery(Query $query, $fields = array()) { - if ($query->getUsePagedResults()) { + if ($query->getUsePagedResults() && version_compare(PHP_VERSION, '5.4.0') >= 0) { if ($this->pageCookie === null) { $this->pageCookie = ''; } else { diff --git a/library/Icinga/Protocol/Ldap/Query.php b/library/Icinga/Protocol/Ldap/Query.php index 930cefa96..c6f0d6fa1 100644 --- a/library/Icinga/Protocol/Ldap/Query.php +++ b/library/Icinga/Protocol/Ldap/Query.php @@ -33,7 +33,7 @@ class Query protected $sort_columns = array(); protected $count; protected $base; - protected $usePagedResults; + protected $usePagedResults = true; /** * Constructor @@ -44,7 +44,6 @@ class Query public function __construct(Connection $connection) { $this->connection = $connection; - $this->usePagedResults = version_compare(PHP_VERSION, '5.4.0') >= 0; } public function setBase($base) @@ -65,7 +64,7 @@ class Query public function setUsePagedResults($state = true) { - $this->usePagedResults = (bool) $state && version_compare(PHP_VERSION, '5.4.0') >= 0; + $this->usePagedResults = (bool) $state; return $this; }