Prevent arbritary js code from beign returned from the database

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner
2021-07-23 18:47:37 +01:00
parent 7e602e0df4
commit 8066069a1f

View File

@@ -510,6 +510,9 @@ if ($_POST['action'] == 'get_groups') {
$res['domain'] = $utf8_domain.' ('.$res['domain'].')';
}
}
// Prevent domain and comment fields from returning any arbitary javascript code which could be executed on the browser.
$res['domain'] = htmlentities($res['domain']);
$res['comment'] = htmlentities($res['comment']);
array_push($data, $res);
}