You are here

function BotchaRecipeHoneypot::isSpam in BOTCHA Spam Prevention 7.2

Same name and namespace in other branches
  1. 6.2 controller/botcha_recipe.controller.inc \BotchaRecipeHoneypot::isSpam()
  2. 6.3 controller/recipe/botcha.recipe.controller.inc \BotchaRecipeHoneypot::isSpam()
  3. 7.3 controller/recipe/botcha.recipe.controller.inc \BotchaRecipeHoneypot::isSpam()

Spam check.

_state

Parameters

type $form:

Overrides BotchaRecipe::isSpam

File

controller/botcha_recipe.controller.inc, line 642
Controller layer of the BotchaRecipe objects.

Class

BotchaRecipeHoneypot

Code

function isSpam($form, $form_state) {
  $isSpam = parent::isSpam($form, $form_state);
  foreach ($this
    ->generateFormElements() as $field_name => $formElement) {
    if (isset($formElement['!valid_token']) && isset($form_state['botcha_submit_values'][$field_name]) && $form_state['botcha_submit_values'][$field_name] !== $formElement['!valid_token']) {
      $isSpam = TRUE;
      break;
    }
  }
  return $isSpam;
}