]> source.dussan.org Git - nextcloud-server.git/commitdiff
fixes infinitely repeating LDPA search results with PHP <= 7.2 21108/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Mon, 25 May 2020 22:33:21 +0000 (00:33 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Mon, 25 May 2020 22:37:46 +0000 (00:37 +0200)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
apps/user_ldap/lib/Access.php

index 16013555d4efc0ea168fbb7eaf05451412284bc3..d58106707efa91967056e5185eeb8f8040beaaf5 100644 (file)
@@ -2049,6 +2049,12 @@ class Access extends LDAPUtility {
                                // of '0' is valid, because 389ds
                                $reOffset = ($offset - $limit) < 0 ? 0 : $offset - $limit;
                                $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) {
                                //since offset = 0, this is a new search. We abandon other searches that might be ongoing.