diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2021-09-13 11:01:35 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2021-09-13 11:01:35 +0200 |
commit | 474a5b55d39e621c12947b50ea6c8febfceed7d7 (patch) | |
tree | f01f0a9291626531899b0ae07b125d5b20a87264 | |
parent | 358eaba7dd45e5c5dbce44011bd7eadd88fe8534 (diff) | |
download | nextcloud-server-474a5b55d39e621c12947b50ea6c8febfceed7d7.tar.gz nextcloud-server-474a5b55d39e621c12947b50ea6c8febfceed7d7.zip |
Implement review feedback
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
-rw-r--r-- | core/Migrations/Version23000Date20210906132259.php | 4 | ||||
-rw-r--r-- | lib/private/Security/RateLimiting/Backend/DatabaseBackend.php | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/core/Migrations/Version23000Date20210906132259.php b/core/Migrations/Version23000Date20210906132259.php index e65846f40b9..26d18edc8f1 100644 --- a/core/Migrations/Version23000Date20210906132259.php +++ b/core/Migrations/Version23000Date20210906132259.php @@ -34,8 +34,8 @@ class Version23000Date20210906132259 extends SimpleMigrationStep { $table->addColumn('delete_after', Types::DATETIME, [ 'notnull' => true, ]); - $table->addIndex(['hash'], 'ratelimit_hash_idx'); - $table->addIndex(['delete_after'], 'ratelimit_delete_after_idx'); + $table->addIndex(['hash'], 'ratelimit_hash'); + $table->addIndex(['delete_after'], 'ratelimit_delete_after'); return $schema; } diff --git a/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php b/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php index 5f579bfef85..1415b5c4131 100644 --- a/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php +++ b/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php @@ -74,7 +74,7 @@ class DatabaseBackend implements IBackend { $qb->delete(self::TABLE_NAME) ->where( $qb->expr()->lte('delete_after', $qb->createNamedParameter($currentTime, IQueryBuilder::PARAM_DATE)) - ); + ) ->executeStatement(); $qb = $this->dbConnection->getQueryBuilder(); @@ -88,10 +88,10 @@ class DatabaseBackend implements IBackend { ); $cursor = $qb->executeQuery(); - $row = $cursor->fetch(); + $row = $cursor->fetchOne(); $cursor->closeCursor(); - return (int)$row['count']; + return (int)$row; } /** |