Use ->fetchAll() in TotpMultifactorMethod
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 21 Dec 2020 08:34:27 +0000 (09:34 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 21 Dec 2020 08:35:04 +0000 (09:35 +0100)
wcfsetup/install/files/lib/system/user/multifactor/TotpMultifactorMethod.class.php

index e1e1fa79bd48f77ba1079841f5e87b0e261a8013..43802fb0384484ad3dc58b872a38f9132e203992 100644 (file)
@@ -113,9 +113,7 @@ class TotpMultifactorMethod implements IMultifactorMethod {
                        $statement->execute([$setup->getId()]);
                        $devicesContainer = DevicesContainer::create('devices')
                                ->label('wcf.user.security.multifactor.totp.devices');
-                       while ($row = $statement->fetchArray()) {
-                               $devices[] = $row;
-                       }
+                       $devices = $statement->fetchAll(\PDO::FETCH_ASSOC);
                        
                        $canBeDeleted = \count($devices) > 1;
                        foreach ($devices as $row) {