Browse Source

run content through check plain before displaying, sending to relais or logging

9.x-1.0
Paul Pound 8 years ago
parent
commit
8744ef3a80
  1. 15
      includes/utilities.inc

15
includes/utilities.inc

@ -4,6 +4,20 @@
* Contains helper functions for working with Relais requests.
*/
/**
* Clean the form content before sending it to relais or logging it.
*
* @param $value
* @param $key
*/
function upei_roblib_ill_check_arr_item(&$value, $key) {
if(is_array($value)) {
array_walk($value, 'upei_roblib_ill_check_arr_item');
} else {
$value = check_plain($value);
}
}
/**
* Removes empty elements and drupal specific elements from an array
*
@ -47,6 +61,7 @@ function upei_roblib_ill_clean_array($values) {
unset($arr['doi']);
unset($arr['doi_button']);
unset($arr['honeypot_time']);
array_walk($arr, 'upei_roblib_ill_check_arr_item');
return $arr;
}

Loading…
Cancel
Save