"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "core-bundle/src/Migration/Version411/TwoFactorBackupCodesMigration.php" between
contao-4.11.3.tar.gz and contao-4.11.4.tar.gz

About: Contao (fka TYPOlight) is a content management system (CMS). Latest release.

TwoFactorBackupCodesMigration.php  (contao-4.11.3):TwoFactorBackupCodesMigration.php  (contao-4.11.4)
skipping to change at line 80 skipping to change at line 80
if (!\is_array($backupCodes)) { if (!\is_array($backupCodes)) {
continue; continue;
} }
foreach ($backupCodes as $key => $backupCode) { foreach ($backupCodes as $key => $backupCode) {
$backupCodes[$key] = password_hash($backupCode, PASSWORD_DEFAULT ); $backupCodes[$key] = password_hash($backupCode, PASSWORD_DEFAULT );
} }
$this->connection $this->connection
->prepare("UPDATE $table SET backupCodes = :backupCodes WHERE id = :id") ->prepare("UPDATE $table SET backupCodes = :backupCodes WHERE id = :id")
->execute([ ->executeStatement([
':backupCodes' => json_encode($backupCodes), ':backupCodes' => json_encode($backupCodes),
':id' => $row['id'], ':id' => $row['id'],
]) ])
; ;
} }
} }
private function getAffectedRowsForTable(string $table): array private function getAffectedRowsForTable(string $table): array
{ {
$statement = $this->connection->prepare(" return $this->connection->fetchAllAssociative("
SELECT id, backupCodes SELECT id, backupCodes
FROM $table FROM $table
WHERE backupCodes IS NOT NULL AND backupCodes REGEXP '[a-f0-9]{6}-[a -f0-9]{6}' WHERE backupCodes IS NOT NULL AND backupCodes REGEXP '[a-f0-9]{6}-[a -f0-9]{6}'
"); ");
$statement->execute();
return $statement->fetchAllAssociative();
} }
} }
 End of changes. 3 change blocks. 
6 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)