encode uri and html

This commit is contained in:
Eric A. Miller
2014-05-27 23:15:12 -04:00
parent 160756bbb6
commit 20b8de9d86
6 changed files with 192 additions and 167 deletions

View File

@@ -15,18 +15,26 @@ $(document).ready(function() {
"deferRender": true,
"data": [% results %],
"columns": [{
data: 'ip',
render: function(data, type, row, meta) {
return '<a href="[% search_device %]&q=' + data + '">' + (row.dns || row.name || row.ip) + '</a>';
"data": 'ip',
"render": function(data, type, row, meta) {
return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.name || row.ip) + '</a>';
}
}, {
data: 'alias'
"data": 'alias',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
data: 'contact'
"data": 'contact',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
data: 'location'
"data": 'location',
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}
]
});
});</script>