From e43829b916b3ee9adcfcd899a56c931bc62090cc Mon Sep 17 00:00:00 2001 From: Alexander Steshuk Date: Wed, 19 Feb 2020 16:40:05 +0200 Subject: [PATCH] security-package/issues/121: Fix missed variable. --- ReCaptcha/Model/CaptchaValidator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ReCaptcha/Model/CaptchaValidator.php b/ReCaptcha/Model/CaptchaValidator.php index 2285f4f0..1a380613 100644 --- a/ReCaptcha/Model/CaptchaValidator.php +++ b/ReCaptcha/Model/CaptchaValidator.php @@ -32,8 +32,9 @@ public function validate( // @codingStandardsIgnoreEmd if ($validationConfig->getCaptchaType() === 'recaptcha_v3') { - if (isset($options['threshold'])) { - $reCaptcha->setScoreThreshold($validationConfig->getScoreThreshold()); + $scoreThreshold = $validationConfig->getScoreThreshold(); + if ($validationConfig->getCaptchaType() === 'recaptcha_v3' && $scoreThreshold !== null) { + $reCaptcha->setScoreThreshold($scoreThreshold); } } $res = $reCaptcha->verify($reCaptchaResponse, $validationConfig->getRemoteIp());