Commit 3007afe3 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) add legacy_html_escape_form_data to legacy helper functions to escape...

(legacy) add legacy_html_escape_form_data to legacy helper functions to escape array items recursive
parent 50c05fbc
......@@ -55,3 +55,20 @@ function configd_run($cmd, $detach = false)
$backend = new OPNsense\Core\Backend();
return $backend->configdRun("{$cmd}", $detach);
}
/**
* simple function to perform htmlspecialchars recursively on all attributes
* @param $settings array type form data
*/
function legacy_html_escape_form_data(&$settings)
{
if (is_array($settings)) {
foreach ($settings as $dataKey => &$dataValue) {
if (is_array($dataValue)) {
legacy_html_escape_form_data($dataValue);
} else {
$settings[$dataKey] = htmlspecialchars($dataValue);
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment