Fix critical extension when reseting paged control

This commit is contained in:
Jérémy Derussé 2020-11-16 12:44:36 +01:00
parent 091265bbbb
commit a2b74762a6
No known key found for this signature in database
GPG Key ID: 2083FA5758C473D2
1 changed files with 5 additions and 5 deletions

View File

@ -100,7 +100,7 @@ class Query extends AbstractQuery
$cookie = '';
do {
if ($pageControl) {
$this->controlPagedResult($con, $pageSize, $cookie);
$this->controlPagedResult($con, $pageSize, true, $cookie);
}
$sizeLimit = $itemsLeft;
if ($pageSize > 0 && $sizeLimit >= $pageSize) {
@ -174,7 +174,7 @@ class Query extends AbstractQuery
private function resetPagination()
{
$con = $this->connection->getResource();
$this->controlPagedResult($con, 0, '');
$this->controlPagedResult($con, 0, false, '');
$this->serverctrls = [];
// This is a workaround for a bit of a bug in the above invocation
@ -204,15 +204,15 @@ class Query extends AbstractQuery
*
* @param resource $con
*/
private function controlPagedResult($con, int $pageSize, string $cookie): bool
private function controlPagedResult($con, int $pageSize, bool $critical, string $cookie): bool
{
if (\PHP_VERSION_ID < 70300) {
return ldap_control_paged_result($con, $pageSize, true, $cookie);
return ldap_control_paged_result($con, $pageSize, $critical, $cookie);
}
$this->serverctrls = [
[
'oid' => \LDAP_CONTROL_PAGEDRESULTS,
'isCritical' => true,
'isCritical' => $critical,
'value' => [
'size' => $pageSize,
'cookie' => $cookie,