Skip to content
Code-Schnipsel Gruppen Projekte
Commit 77d589ae erstellt von Patrick Müller's avatar Patrick Müller
Dateien durchsuchen

fix: check CAPTCHA if JavaScript is disabled (contact)

Übergeordneter 09f51f91
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -7,6 +7,7 @@
namespace QUI\Bricks\Controls;
use QUI;
use QUI\Captcha\Handler as CaptchaHandler;
/**
* Mini contact control
......@@ -63,6 +64,18 @@ public function getBody()
&& isset($_POST['email'])
&& isset($_POST['message'])
) {
if ($useCaptcha && QUI::getPackageManager()->isInstalled('quiqqer/captcha')) {
if (empty($_POST['quiqqer-captcha-response'])
|| !CaptchaHandler::isResponseValid($_POST['quiqqer-captcha-response'])) {
throw new QUI\Exception(
QUI::getLocale()->get(
'quiqqer/bricks',
'brick.control.simpleContact.error.captcha_failed'
)
);
}
}
if ($privacyPolicyCheckbox && empty($_POST['privacyPolicy'])) {
$Engine->assign([
'errorMessage' => QUI::getLocale()->get(
......
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