Browse Source

remove captcha data from array

9.x-3.0
Paul Pound 2 weeks ago
parent
commit
edf5ca1798
  1. 16
      includes/utilities.inc

16
includes/utilities.inc

@ -170,17 +170,21 @@ function upei_roblib_ill_clean_array($values)
unset($arr['doi']); unset($arr['doi']);
unset($arr['doi_button']); unset($arr['doi_button']);
unset($arr['honeypot_time']); unset($arr['honeypot_time']);
unset($arr['captcha_sid']);
unset($arr['captcha_token']);
unset($arr['captcha_response']);
array_walk($arr, 'upei_roblib_ill_check_arr_item'); array_walk($arr, 'upei_roblib_ill_check_arr_item');
return $arr; return $arr;
} }
function upei_roblib_ill_check_arr_item(&$value, $key) { function upei_roblib_ill_check_arr_item(&$value, $key)
{
if (is_array($value)) { if (is_array($value)) {
array_walk($value, 'upei_roblib_ill_check_arr_item'); array_walk($value, 'upei_roblib_ill_check_arr_item');
} }
//else { //else {
// $value = Xss::filter($value); // $value = Xss::filter($value);
//} //}
} }
@ -196,7 +200,7 @@ function upei_roblib_ill_check_arr_item(&$value, $key) {
*/ */
function upei_roblib_format_biblio_info($form_state) function upei_roblib_format_biblio_info($form_state)
{ {
$values = $form_state->getValues(); $values = $form_state->getValues();
$data = upei_roblib_ill_clean_array($values); $data = upei_roblib_ill_clean_array($values);
$rows = []; $rows = [];
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
@ -213,4 +217,4 @@ function upei_roblib_format_biblio_info($form_state)
]; ];
$html_output = \Drupal::service('renderer')->render($output); $html_output = \Drupal::service('renderer')->render($output);
return $html_output; return $html_output;
} }
Loading…
Cancel
Save