You are here

function _captcha_parse_captcha_type in CAPTCHA 7

Same name and namespace in other branches
  1. 8 captcha.inc \_captcha_parse_captcha_type()
  2. 6.2 captcha.inc \_captcha_parse_captcha_type()

Parse or interpret the given captcha_type.

Parameters

string $captcha_type: string representation of the CAPTCHA type, e.g. 'default', 'none', 'captcha/Math', 'image_captcha/Image'

Return value

array list($captcha_module, $captcha_type)

1 call to _captcha_parse_captcha_type()
captcha_element_process in ./captcha.module
Process callback for CAPTCHA form element.

File

./captcha.inc, line 308
General CAPTCHA functionality and helper functions.

Code

function _captcha_parse_captcha_type($captcha_type) {
  if ($captcha_type == 'none') {
    return array(
      NULL,
      NULL,
    );
  }
  if ($captcha_type == 'default') {
    $captcha_type = variable_get('captcha_default_challenge', 'captcha/Math');
  }
  return explode('/', $captcha_type);
}