function _botcha_filter_value in BOTCHA Spam Prevention 7
Same name and namespace in other branches
- 7.2 botcha.inc \_botcha_filter_value()
- 7.3 botcha.module \_botcha_filter_value()
Filter out sensitive form data from values for logging.
3 calls to _botcha_filter_value()
- botcha_form_alter_botcha in ./
botcha.botcha.inc - Main BOTCHA worker - process the form and apply BOTCHA protection
- _botcha_filter_form_log in ./
botcha.botcha.inc - Filter out sensitive form data for logging Recursive.
- __botcha_form_validate in ./
botcha.botcha.inc - Custom form validation.
File
- ./
botcha.botcha.inc, line 520 - Implementation of botcha form logic.
Code
function _botcha_filter_value($value) {
$filtered_value = $value;
if (is_string($value)) {
$filtered_value = '********';
}
elseif (is_array($value)) {
foreach ($value as $key => $key_value) {
// Filter out sensitive data.
if (in_array($key, array(
'pass',
'pass1',
'pass2',
'#value',
))) {
$filtered_value[$key] = _botcha_filter_value($key_value);
}
}
}
return $filtered_value;
}