You are here

function _text_captcha_word_pool_validate_word_length in CAPTCHA Pack 7

Same name and namespace in other branches
  1. 8 text_captcha/text_captcha.module \_text_captcha_word_pool_validate_word_length()
  2. 5 text_captcha/text_captcha.inc \_text_captcha_word_pool_validate_word_length()
  3. 6 text_captcha/text_captcha.inc \_text_captcha_word_pool_validate_word_length()
1 call to _text_captcha_word_pool_validate_word_length()
_text_captcha_word_pool_validate in text_captcha/text_captcha.inc
Helper function for validating the word pool Locale dependent

File

text_captcha/text_captcha.inc, line 104

Code

function _text_captcha_word_pool_validate_word_length($name, $words, $minimum_length, $too_short_message) {
  $too_short = array();
  foreach ($words as $word) {
    if (count(_text_captcha_utf8_split($word)) < $minimum_length) {
      $too_short[] = $word;
    }
  }
  if (count($too_short)) {
    form_set_error($name, t($too_short_message, array(
      '@minimum_length' => $minimum_length,
      '@words' => implode(', ', $too_short),
    )));
  }
}