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
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
namespace QUI\Bricks\Controls; namespace QUI\Bricks\Controls;
use QUI; use QUI;
use QUI\Captcha\Handler as CaptchaHandler;
/** /**
* Mini contact control * Mini contact control
...@@ -63,6 +64,18 @@ public function getBody() ...@@ -63,6 +64,18 @@ public function getBody()
&& isset($_POST['email']) && isset($_POST['email'])
&& isset($_POST['message']) && 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'])) { if ($privacyPolicyCheckbox && empty($_POST['privacyPolicy'])) {
$Engine->assign([ $Engine->assign([
'errorMessage' => QUI::getLocale()->get( 'errorMessage' => QUI::getLocale()->get(
......
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