You are here

function _captcha_parse_captcha_type in CAPTCHA 8

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

Parse or interpret the given captcha_type.

Parameters

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

Return value

array list($captcha_module, $captcha_type).

1 call to _captcha_parse_captcha_type()
Captcha::processCaptchaElement in src/Element/Captcha.php
Process callback for CAPTCHA form element.

File

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

Code

function _captcha_parse_captcha_type($captcha_type) {
  if ($captcha_type == 'default') {
    $captcha_type = \Drupal::config('captcha.settings')
      ->get('default_challenge', 'captcha/Math');
  }
  return explode('/', $captcha_type);
}