Skip to content

Commit dec16a9

Browse files
authored
Merge pull request #33157 from nextcloud/backport/33153/stable24
2 parents 09d6d02 + d306757 commit dec16a9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/private/Security/Bruteforce/Throttler.php

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

7171
public function __construct(IDBConnection $db,
7272
ITimeFactory $timeFactory,
@@ -225,7 +225,7 @@ public function getAttempts(string $ip, string $action = '', float $maxAgeHours
225225
$maxAgeHours = 48;
226226
}
227227

228-
if ($ip === '' || $this->hasAttemptsDeleted) {
228+
if ($ip === '' || isset($this->hasAttemptsDeleted[$action])) {
229229
return 0;
230230
}
231231

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

304304
$qb->executeStatement();
305305

306-
$this->hasAttemptsDeleted = true;
306+
$this->hasAttemptsDeleted[$action] = true;
307307
}
308308

309309
/**

0 commit comments

Comments
 (0)