Make content safe too

This commit is contained in:
Mark Schouten 2014-05-26 12:28:16 +02:00
parent a0df8f8413
commit 2a6fd69192

View file

@ -216,7 +216,8 @@ if ($action == "list" or $action== "listslaves") {
$any = array();
foreach ($rows['records'] as $idx => $record) {
$rows['records'][$idx]['id'] = json_encode($record);
$record['name'] = htmlspecialchars($record['name']);
$rows['records'][$idx]['name'] = htmlspecialchars($record['name']);
$rows['records'][$idx]['content'] = htmlspecialchars($record['content']);
if ($record['type'] == 'SOA') { array_push($soa, $rows['records'][$idx]); }
elseif ($record['type'] == 'NS') { array_push($ns, $rows['records'][$idx]); }
elseif ($record['type'] == 'MX') { array_push($mx, $rows['records'][$idx]); }
@ -240,7 +241,9 @@ if ($action == "list" or $action== "listslaves") {
}
$records =_create_record($name, $records, $_POST, $_GET['zoneurl']);
_jtable_respond($records[sizeof($records)-1], 'single');
$ret = $records[sizeof($records)-1];
$ret['content'] = htmlspecialchars($ret['content']);
_jtable_respond($ret, 'single');
} elseif ($action == "deleterecord") {
$todel = json_decode($_POST['id'], 1);
$records = getrecords_by_name_type($_GET['zoneurl'], $todel['name'], $todel['type']);