You are here

function _botcha_get_form_cache in BOTCHA Spam Prevention 7

Same name and namespace in other branches
  1. 6 botcha.botcha.inc \_botcha_get_form_cache()
1 call to _botcha_get_form_cache()
__botcha_form_validate in ./botcha.botcha.inc
Custom form validation.

File

./botcha.botcha.inc, line 682
Implementation of botcha form logic.

Code

function _botcha_get_form_cache($form_build_id) {
  if ($cached = cache_get('botcha_' . $form_build_id, 'cache_form')) {
    $data = $cached->data;
    if (isset($data['#cache_token']) && _botcha_valid_token($data['#cache_token'])) {
      return TRUE;
    }
  }
  return FALSE;
}