function lost_character_process in CAPTCHA Pack 6
Same name and namespace in other branches
- 8 text_captcha/modules/lost_character_captcha/lost_character_captcha.module \lost_character_process()
- 7 text_captcha/lost_character_captcha/lost_character_captcha.module \lost_character_process()
Process the response before validation.
1 string reference to 'lost_character_process'
- lost_character_captcha_captcha in text_captcha/
lost_character_captcha/ lost_character_captcha.module - Implementation of hook_captcha().
File
- text_captcha/
lost_character_captcha/ lost_character_captcha.module, line 99
Code
function lost_character_process($element, $edit, &$form_state, $complete_form) {
$response = $element['#value'];
// remove white spaces
$parts = _text_captcha_whitespace_explode($response);
$response = implode('', $parts);
// split in utf8 characters, sort and rejoin
$characters = _text_captcha_utf8_split($response);
sort($characters);
$response = implode('', $characters);
// Put back in element and return.
$element['#value'] = $response;
return $element;
}