diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-03-08 12:10:52 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-03-08 12:10:52 +0100 |
commit | ccab35f23f3b102b11f93e1d5e7e2f4fadadb56f (patch) | |
tree | e38f983fa2e61d5a798398d91876de968db23da7 /apps/user_ldap | |
parent | 65a866556bf871f98ab6486dd104e758c06f039b (diff) | |
download | nextcloud-server-ccab35f23f3b102b11f93e1d5e7e2f4fadadb56f.tar.gz nextcloud-server-ccab35f23f3b102b11f93e1d5e7e2f4fadadb56f.zip |
Fix similar potential problems with fetchOne loops
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/lib/Mapping/AbstractMapping.php | 6 | ||||
-rw-r--r-- | apps/user_ldap/lib/Migration/Version1130Date20211102154716.php | 2 |
2 files changed, 4 insertions, 4 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 c92c4c794ae..3f590df7fa5 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(); |