Skip to content

Commit 4df9c0c

Browse files
LukasReschkebackportbot[bot]
authored andcommitted
Implement review feedback
Signed-off-by: Lukas Reschke <[email protected]>
1 parent f6f1ee0 commit 4df9c0c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

core/Migrations/Version23000Date20210906132259.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
3434
$table->addColumn('delete_after', Types::DATETIME, [
3535
'notnull' => true,
3636
]);
37-
$table->addIndex(['hash'], 'ratelimit_hash_idx');
38-
$table->addIndex(['delete_after'], 'ratelimit_delete_after_idx');
37+
$table->addIndex(['hash'], 'ratelimit_hash');
38+
$table->addIndex(['delete_after'], 'ratelimit_delete_after');
3939
return $schema;
4040
}
4141

lib/private/Security/RateLimiting/Backend/DatabaseBackend.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private function getExistingAttemptCount(
7474
$qb->delete(self::TABLE_NAME)
7575
->where(
7676
$qb->expr()->lte('delete_after', $qb->createNamedParameter($currentTime, IQueryBuilder::PARAM_DATE))
77-
);
77+
)
7878
->executeStatement();
7979

8080
$qb = $this->dbConnection->getQueryBuilder();
@@ -88,10 +88,10 @@ private function getExistingAttemptCount(
8888
);
8989

9090
$cursor = $qb->executeQuery();
91-
$row = $cursor->fetch();
91+
$row = $cursor->fetchOne();
9292
$cursor->closeCursor();
9393

94-
return (int)$row['count'];
94+
return (int)$row;
9595
}
9696

9797
/**

0 commit comments

Comments
 (0)