Implement honeypot field as spam countermeasure
This commit is contained in:
1 parent
e185e4f64c
commit
54bcb03d2f
4 files changed
+38
No files matched your search
@@ -64,6 +64,13 @@ class AjaxFormController extends ActionController
|
||||
public function processFormAction(ContactForm $contactForm)
|
||||
{
|
||||
$response['status'] = 'ok';
|
||||
|
||||
// Don't take further actions in case honeypot field is filled in
|
||||
// as a spam countermeasure
|
||||
if ($contactForm->getSubject()) {
|
||||
return json_encode($response);
|
||||
}
|
||||
|
||||
$this->emailService->send(
|
||||
$this->settings['contactFormToEmail'],
|
||||
$this->settings['contactFormToName'],
|
||||
|
||||
Reference in new issue
Block a user