You are here

function _image_captcha_get_font in CAPTCHA 6

Same name and namespace in other branches
  1. 5.3 image_captcha/image_captcha.module \_image_captcha_get_font()

Returns:

  • the path to the image CAPTCHA font or FALSE when an error occured
  • error message
3 calls to _image_captcha_get_font()
image_captcha_captcha in image_captcha/image_captcha.module
Implementation of hook_captcha
image_captcha_settings_form in image_captcha/image_captcha.admin.inc
Configuration form for image_captcha
_image_captcha_generate_image in image_captcha/image_captcha.user.inc
base function for generating a image CAPTCHA

File

image_captcha/image_captcha.module, line 55

Code

function _image_captcha_get_font() {
  $font = variable_get('image_captcha_font', 'BUILTIN');
  $errmsg = FALSE;
  $errvar = array();
  if ($font != 'BUILTIN' && (!is_file($font) || !is_readable($font))) {
    $errmsg = 'Could not find or read the configured font "%font" for the image captcha.';
    $errvar = array(
      '%font' => $font,
    );
    $font = FALSE;
  }
  return array(
    $font,
    $errmsg,
    $errvar,
  );
}