Changed CSRF hidden function for allow return

This commit is contained in:
Jose Gonzalez 2021-04-09 13:30:31 +02:00
parent 4adb9827cb
commit ee858280e1
1 changed files with 6 additions and 2 deletions

View File

@ -4298,10 +4298,14 @@ function html_print_sort_arrows($params, $order_tag, $up='up', $down='down')
/**
* Print an input hidden with a new csrf token generated
*
* @param boolean $return If it is true return a string with the output instead to echo the output.
*
* @return void
*/
function html_print_csrf_hidden()
function html_print_csrf_hidden(bool $return=false)
{
html_print_input_hidden('csrf_code', generate_csrf_code());
return html_print_input_hidden('csrf_code', generate_csrf_code(), $return);
}