You are here

function foo_captcha_process in CAPTCHA Pack 8

Same name and namespace in other branches
  1. 6 foo_captcha/foo_captcha.module \foo_captcha_process()
  2. 7 foo_captcha/foo_captcha.module \foo_captcha_process()

Process the response to the foo CAPTCHA before validation.

1 string reference to 'foo_captcha_process'
foo_captcha_captcha in foo_captcha/foo_captcha.module
Implements hook_captcha().

File

foo_captcha/foo_captcha.module, line 48
Contains general functionality of the module.

Code

function foo_captcha_process($element, $edit) {
  if (\Drupal::config('foo_captcha.settings')
    ->get('foo_captcha_ignore_spaces')) {
    $element['#value'] = preg_replace('/\\s*/', '', $element['#value']);
  }
  return $element;
}