Skip to content

Fix critical extension when reseting paged control #39092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Symfony/Component/Ldap/Adapter/ExtLdap/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function execute()
$cookie = '';
do {
if ($pageControl) {
$this->controlPagedResult($con, $pageSize, $cookie);
$this->controlPagedResult($con, $pageSize, true, $cookie);
}
$sizeLimit = $itemsLeft;
if ($pageSize > 0 && $sizeLimit >= $pageSize) {
Expand Down Expand Up @@ -174,7 +174,7 @@ public function getResources(): array
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
Expand Down Expand Up @@ -204,15 +204,15 @@ private function resetPagination()
*
* @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,
Expand Down