summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2022-04-14 12:39:51 +0200
committerGitHub <noreply@github.com>2022-04-14 12:39:51 +0200
commit76f2400e1ebc18a045dc296b9393dcff1d716463 (patch)
treeead57ad74e1d2c98698f78a04906e282765cb59a /apps/user_ldap
parent8f171881cc175f79eff2224802baff872e4bc9a1 (diff)
parent503b7422f56a0332c2cae5b9029fe75c36353515 (diff)
downloadnextcloud-server-76f2400e1ebc18a045dc296b9393dcff1d716463.tar.gz
nextcloud-server-76f2400e1ebc18a045dc296b9393dcff1d716463.zip
Merge pull request #31522 from nextcloud/backport/31491/stable22
[stable22] Fix duplicated UUID detection when there are empty uuids
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/lib/Mapping/AbstractMapping.php6
-rw-r--r--apps/user_ldap/lib/Migration/Version1130Date20211102154716.php4
2 files changed, 5 insertions, 5 deletions
diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php
index 16973f76ff4..1a747cc8bfd 100644
--- a/apps/user_ldap/lib/Mapping/AbstractMapping.php
+++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php
@@ -438,14 +438,14 @@ abstract class AbstractMapping {
$picker = $this->dbc->getQueryBuilder();
$picker->select('owncloud_name')
->from($this->getTableName());
- $cursor = $picker->execute();
+ $cursor = $picker->executeQuery();
$result = true;
- while ($id = $cursor->fetchOne()) {
+ while (($id = $cursor->fetchOne()) !== false) {
$preCallback($id);
if ($isUnmapped = $this->unmap($id)) {
$postCallback($id);
}
- $result &= $isUnmapped;
+ $result = $result && $isUnmapped;
}
$cursor->closeCursor();
return $result;
diff --git a/apps/user_ldap/lib/Migration/Version1130Date20211102154716.php b/apps/user_ldap/lib/Migration/Version1130Date20211102154716.php
index 9e9554000d8..024c5801582 100644
--- a/apps/user_ldap/lib/Migration/Version1130Date20211102154716.php
+++ b/apps/user_ldap/lib/Migration/Version1130Date20211102154716.php
@@ -259,7 +259,7 @@ class Version1130Date20211102154716 extends SimpleMigrationStep {
$result = $select->executeQuery();
$idList = [];
- while ($id = $result->fetchOne()) {
+ while (($id = $result->fetchOne()) !== false) {
$idList[] = $id;
}
$result->closeCursor();
@@ -278,7 +278,7 @@ class Version1130Date20211102154716 extends SimpleMigrationStep {
->having($select->expr()->gt($select->func()->count('owncloud_name'), $select->createNamedParameter(1)));
$result = $select->executeQuery();
- while ($uuid = $result->fetchOne()) {
+ while (($uuid = $result->fetchOne()) !== false) {
yield $uuid;
}
$result->closeCursor();