You are here

public function BotchaRecipebook::isSpam in BOTCHA Spam Prevention 7.3

Same name and namespace in other branches
  1. 6.3 controller/recipebook/botcha.recipebook.controller.inc \BotchaRecipebook::isSpam()

Spam check. Currently the logic is as follows: if we could find a recipe that failed spam check - then we consider this form submission as spam and decline it.

_state

Parameters

array $form:

array $is_spam:

Return value

boolean

File

controller/recipebook/botcha.recipebook.controller.inc, line 302
Controller layer of the BotchaRecipebook objects.

Class

BotchaRecipebook

Code

public function isSpam($form, $form_state, $is_spam) {

  // Consider form submission as a spam if at least one recipe considered it
  // as a spam.
  return count($is_spam) ? (bool) array_diff($is_spam, array_fill(0, count($is_spam), FALSE)) : FALSE;
}