You are here

function antispam_get_anti_spambot_rules in AntiSpam 6

Same name and namespace in other branches
  1. 7 antispam.module \antispam_get_anti_spambot_rules()

Get anti-spambot rules.

Return value

array

3 calls to antispam_get_anti_spambot_rules()
antispam_is_anti_spambot_enabled in ./antispam.module
Check if anti-spambot options are enabled.
_antispam_comment_form_validate in ./antispam.module
Comment form validate callback; check for spambots.
_antispam_node_form_validate in ./antispam.module
Node form validate callback; check for spambots.

File

./antispam.module, line 1066

Code

function antispam_get_anti_spambot_rules() {
  static $antispambot_rules = FALSE;
  if (!$antispambot_rules) {
    $antispambot_rules = array();
    $options = variable_get('antispam_antispambot_rules', array());
    if (is_array($options)) {
      foreach ($options as $key => $value) {
        if (is_string($key)) {
          $antispambot_rules[$key] = $key === $value ? TRUE : FALSE;
        }
      }
    }
  }
  return $antispambot_rules;
}