fixes infinitely repeating LDPA search results with PHP <= 7.2

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2020-05-26 00:33:21 +02:00 committed by backportbot[bot]
parent 24e97c1a7c
commit d0559a4871
1 changed files with 6 additions and 0 deletions

View File

@ -2049,6 +2049,12 @@ class Access extends LDAPUtility {
// of '0' is valid, because 389ds // of '0' is valid, because 389ds
$reOffset = ($offset - $limit) < 0 ? 0 : $offset - $limit; $reOffset = ($offset - $limit) < 0 ? 0 : $offset - $limit;
$this->search($filter, $base, $attr, $limit, $reOffset, true); $this->search($filter, $base, $attr, $limit, $reOffset, true);
if (!$this->hasMoreResults()) {
// when the cookie is reset with != 0 offset, there are no further
// results, so stop. This if block is not necessary with new API
// and can be removed with dropping PHP 7.2
return false;
}
} }
if ($this->lastCookie !== '' && $offset === 0) { if ($this->lastCookie !== '' && $offset === 0) {
//since offset = 0, this is a new search. We abandon other searches that might be ongoing. //since offset = 0, this is a new search. We abandon other searches that might be ongoing.