mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2024-12-13 18:31:10 +01:00
Add function htmlEntities
`htmlentities()` is a function which converts special characters. This allows you to show to display the string without the browser reading it as HTML.
This commit is contained in:
parent
3f245871ac
commit
2c7065e0c4
@ -330,7 +330,11 @@
|
||||
function get_url(row) {
|
||||
return "{% url 'helpdesk:view' 1234 %}".replace(/1234/, row.id.toString());
|
||||
}
|
||||
|
||||
|
||||
function htmlEntities(str) {
|
||||
return String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
// Ticket DataTable Initialization
|
||||
$('#ticketTable').DataTable({
|
||||
@ -366,7 +370,7 @@
|
||||
if (type === 'display') {
|
||||
data = '<div class="tickettitle"><a href="' + get_url(row) + '" >' +
|
||||
row.id + '. ' +
|
||||
row.title + '</a></div>';
|
||||
htmlEntities(row.title) + '</a></div>';
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user