Merge pull request #33157 from nextcloud/backport/33153/stable24

This commit is contained in:
John Molakvoæ 2022-07-08 08:28:29 +02:00 committed by GitHub
commit dec16a9543
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,8 +65,8 @@ class Throttler {
private LoggerInterface $logger;
/** @var IConfig */
private $config;
/** @var bool */
private $hasAttemptsDeleted = false;
/** @var bool[] */
private $hasAttemptsDeleted = [];
public function __construct(IDBConnection $db,
ITimeFactory $timeFactory,
@ -225,7 +225,7 @@ class Throttler {
$maxAgeHours = 48;
}
if ($ip === '' || $this->hasAttemptsDeleted) {
if ($ip === '' || isset($this->hasAttemptsDeleted[$action])) {
return 0;
}
@ -303,7 +303,7 @@ class Throttler {
$qb->executeStatement();
$this->hasAttemptsDeleted = true;
$this->hasAttemptsDeleted[$action] = true;
}
/**