diff --git a/src/Model/Table/CaptchasTable.php b/src/Model/Table/CaptchasTable.php index eb0134e..81aac7a 100644 --- a/src/Model/Table/CaptchasTable.php +++ b/src/Model/Table/CaptchasTable.php @@ -102,15 +102,17 @@ public function buildRules(RulesChecker $rules): RulesChecker { * @return int */ public function touch($sessionId, $ip) { - /** @var int $probability */ - $probability = Configure::read('Captcha.cleanupProbability') ?? 10; - $this->cleanup((int)$probability); + $probability = (int)Configure::read('Captcha.cleanupProbability') ?: 10; + $this->cleanup($probability); $captcha = $this->newEntity( [ 'session_id' => $sessionId, 'ip' => $ip, ], + [ + 'validate' => false, + ], ); if (!$this->save($captcha)) { throw new BadMethodCallException('Sth went wrong: ' . print_r($captcha->getErrors(), true));