diff --git a/includes/utilities.inc b/includes/utilities.inc index 800009e..3ab94ee 100644 --- a/includes/utilities.inc +++ b/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; }