Skip to content

Commit b93bde1

Browse files
authored
Merge pull request #33158 from nextcloud/backport/33153/stable23
2 parents f8d196e + 3c24ba3 commit b93bde1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/private/Security/Bruteforce/Throttler.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ class Throttler {
6666
private $logger;
6767
/** @var IConfig */
6868
private $config;
69-
/** @var bool */
70-
private $hasAttemptsDeleted = false;
69+
/** @var bool[] */
70+
private $hasAttemptsDeleted = [];
7171

7272
/**
7373
* @param IDBConnection $db
@@ -232,7 +232,7 @@ public function getAttempts(string $ip, string $action = '', float $maxAgeHours
232232
$maxAgeHours = 48;
233233
}
234234

235-
if ($ip === '' || $this->hasAttemptsDeleted) {
235+
if ($ip === '' || isset($this->hasAttemptsDeleted[$action])) {
236236
return 0;
237237
}
238238

@@ -310,7 +310,7 @@ public function resetDelay(string $ip, string $action, array $metadata): void {
310310

311311
$qb->executeStatement();
312312

313-
$this->hasAttemptsDeleted = true;
313+
$this->hasAttemptsDeleted[$action] = true;
314314
}
315315

316316
/**

0 commit comments

Comments
 (0)