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
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
2 Merge Requests!32Next,!31Dev
......@@ -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)) {
throw new QUI\Exception(
QUI::getLocale()->get(
......
......@@ -10,6 +10,8 @@
use QUI;
use QUI\Captcha\Handler as CaptchaHandler;
use function class_exists;
/**
* Mini contact control
* {control control="\QUI\Bricks\Controls\SimpleContact" labels=false}
......@@ -106,7 +108,11 @@ public function getBody(): string
&& isset($_POST['email'])
&& isset($_POST['message'])
) {
if ($useCaptcha && QUI::getPackageManager()->isInstalled('quiqqer/captcha')) {
if (
$useCaptcha
&& QUI::getPackageManager()->isInstalled('quiqqer/captcha')
&& class_exists('QUI\Captcha\Handler')
) {
if (
empty($_POST['quiqqer-captcha-response'])
|| !CaptchaHandler::isResponseValid($_POST['quiqqer-captcha-response'])
......@@ -181,7 +187,11 @@ public function getBody(): string
}
// 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());
}
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren