diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-07-31 11:14:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-31 11:14:11 +0300 |
commit | 21095beb67cabc5bd73b448df9601b2fbba76400 (patch) | |
tree | 64805f81f6aa85fd6e7b77e194b941a42ebf27e4 /apps/user_ldap | |
parent | e19bbce7f6e243e0f42633008f4fad02f21732df (diff) | |
parent | d3501be851fe00e02d56aedb69e0281a1d49a681 (diff) |
Merge pull request #22043 from nextcloud/fix/21892/reset-internal-cookie-state
reset the cookie internally in new API when abandoning paged results op
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/lib/PagedResults/Php73.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/PagedResults/Php73.php b/apps/user_ldap/lib/PagedResults/Php73.php index fffac35c27c..7e182e2eabc 100644 --- a/apps/user_ldap/lib/PagedResults/Php73.php +++ b/apps/user_ldap/lib/PagedResults/Php73.php @@ -82,6 +82,12 @@ class Php73 implements IAdapter { 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 { return null; } @@ -94,6 +100,10 @@ class Php73 implements IAdapter { $this->linkData[$linkId]['requestArgs'] = []; $this->linkData[$linkId]['requestArgs']['pageSize'] = $pageSize; $this->linkData[$linkId]['requestArgs']['isCritical'] = $isCritical; + + if ($pageSize === 0) { + $this->resetCookie($linkId); + } } public function getRequestCallArgs($link): array { @@ -153,7 +163,7 @@ class Php73 implements IAdapter { 'oid' => LDAP_CONTROL_PAGEDRESULTS, 'value' => [ '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'] ?? '', ] ]]; |