You are here

function antispam_get_anti_spambot_rules in AntiSpam 7

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

Get anti-spambot rules.

Return value

array

3 calls to antispam_get_anti_spambot_rules()
antispam_comment_presave in ./antispam.module
Implements hook_comment_presave()
antispam_is_anti_spambot_enabled in ./antispam.module
Check if anti-spambot options are enabled.
antispam_node_validate in ./antispam.module
Implements hook_node_validate().

File

./antispam.module, line 1113
Primary hook implementations for the Antispam module.

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;
}