Merge pull request #22043 from nextcloud/fix/21892/reset-internal-cookie-state

reset the cookie internally in new API when abandoning paged results op
This commit is contained in:
Morris Jobke 2020-07-31 10:14:11 +02:00 committed by GitHub
commit 21095beb67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -82,6 +82,12 @@ class Php73 implements IAdapter {
return $this->linkData[$linkId]['serverControls'][LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'] ?? ''; return $this->linkData[$linkId]['serverControls'][LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'] ?? '';
} }
private function resetCookie(int $linkId): void {
if (isset($this->linkData[$linkId]['serverControls'][LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'])) {
$this->linkData[$linkId]['serverControls'][LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'] = '';
}
}
public function getRequestCallFunc(): ?string { public function getRequestCallFunc(): ?string {
return null; return null;
} }
@ -94,6 +100,10 @@ class Php73 implements IAdapter {
$this->linkData[$linkId]['requestArgs'] = []; $this->linkData[$linkId]['requestArgs'] = [];
$this->linkData[$linkId]['requestArgs']['pageSize'] = $pageSize; $this->linkData[$linkId]['requestArgs']['pageSize'] = $pageSize;
$this->linkData[$linkId]['requestArgs']['isCritical'] = $isCritical; $this->linkData[$linkId]['requestArgs']['isCritical'] = $isCritical;
if ($pageSize === 0) {
$this->resetCookie($linkId);
}
} }
public function getRequestCallArgs($link): array { public function getRequestCallArgs($link): array {
@ -153,7 +163,7 @@ class Php73 implements IAdapter {
'oid' => LDAP_CONTROL_PAGEDRESULTS, 'oid' => LDAP_CONTROL_PAGEDRESULTS,
'value' => [ 'value' => [
'size' => $this->linkData[$linkId]['requestArgs']['pageSize'], 'size' => $this->linkData[$linkId]['requestArgs']['pageSize'],
'cookie' => $this->linkData[$linkId]['serverControls'][LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'] ?? '' 'cookie' => $this->linkData[$linkId]['serverControls'][LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'] ?? '',
] ]
]]; ]];