Skip to content
Code-Schnipsel Gruppen Projekte
Bestätigt Commit 06053a88 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

fix: captcha class exists check

Übergeordneter 573a77e3
No related branches found
No related tags found
2 Merge Requests!32Next,!31Dev
...@@ -58,7 +58,11 @@ function ($brickId, $project, $siteId, $message, $name, $email, $privacyPolicyAc ...@@ -58,7 +58,11 @@ function ($brickId, $project, $siteId, $message, $name, $email, $privacyPolicyAc
); );
} }
if ($useCaptcha && QUI::getPackageManager()->isInstalled('quiqqer/captcha')) { if (
$useCaptcha
&& QUI::getPackageManager()->isInstalled('quiqqer/captcha')
&& class_exists('QUI\Captcha\Handler')
) {
if (!CaptchaHandler::isResponseValid($captchaResponse)) { if (!CaptchaHandler::isResponseValid($captchaResponse)) {
throw new QUI\Exception( throw new QUI\Exception(
QUI::getLocale()->get( QUI::getLocale()->get(
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
use QUI; use QUI;
use QUI\Captcha\Handler as CaptchaHandler; use QUI\Captcha\Handler as CaptchaHandler;
use function class_exists;
/** /**
* Mini contact control * Mini contact control
* {control control="\QUI\Bricks\Controls\SimpleContact" labels=false} * {control control="\QUI\Bricks\Controls\SimpleContact" labels=false}
...@@ -106,7 +108,11 @@ public function getBody(): string ...@@ -106,7 +108,11 @@ public function getBody(): string
&& isset($_POST['email']) && isset($_POST['email'])
&& isset($_POST['message']) && isset($_POST['message'])
) { ) {
if ($useCaptcha && QUI::getPackageManager()->isInstalled('quiqqer/captcha')) { if (
$useCaptcha
&& QUI::getPackageManager()->isInstalled('quiqqer/captcha')
&& class_exists('QUI\Captcha\Handler')
) {
if ( if (
empty($_POST['quiqqer-captcha-response']) empty($_POST['quiqqer-captcha-response'])
|| !CaptchaHandler::isResponseValid($_POST['quiqqer-captcha-response']) || !CaptchaHandler::isResponseValid($_POST['quiqqer-captcha-response'])
...@@ -181,7 +187,11 @@ public function getBody(): string ...@@ -181,7 +187,11 @@ public function getBody(): string
} }
// CAPTCHA // CAPTCHA
if ($useCaptcha && QUI::getPackageManager()->isInstalled('quiqqer/captcha')) { if (
$useCaptcha
&& QUI::getPackageManager()->isInstalled('quiqqer/captcha')
&& class_exists('QUI\Captcha\Controls\CaptchaDisplay')
) {
$Engine->assign('CaptchaDisplay', new QUI\Captcha\Controls\CaptchaDisplay()); $Engine->assign('CaptchaDisplay', new QUI\Captcha\Controls\CaptchaDisplay());
} }
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren