Answer the question
In order to leave comments, you need to log in
How to search for a string by regular expression in an array?
There is a site on Drupal 7, on the site there are several feedback forms, from which a ton of rubbish comes. Tried to install ready-made anti-spam modules - no effect.
I want to try to filter spam by implausible names (in the field "Your name:" is written rubbish in Latin) just before sending it to the mail.
Found in the module the function responsible for sending
$message = drupal_mail('webform', 'submission', $address, $language, $mail_params, $email['from']);
if ($message['result']) {
$send_count += $send_increment;
}
if (!array_search(preg_grep('/Ваше имя: ([A-Za-z])*/', $mail_params))){
$message = drupal_mail('webform', 'submission', $address, $language, $mail_params, $email['from']);
if ($message['result']) {
$send_count += $send_increment;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question