mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 16:48:42 +02:00
N°8205 - Security hardening
This commit is contained in:
@@ -156,8 +156,17 @@
|
||||
return row.attributes[attribute_code].sort_value;
|
||||
},
|
||||
filter: function (attribute_code, type, row) {
|
||||
return $.text($.parseHTML(row.attributes[attribute_code]['value_html']));
|
||||
},
|
||||
// Check if the attribute and value_html exist
|
||||
if (!row.attributes[attribute_code] || !row.attributes[attribute_code]['value_html']) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Create a temporary div outside the DOM to filter out XSS
|
||||
const tempDiv = document.createElement('div');
|
||||
tempDiv.textContent = row.attributes[attribute_code]['value_html'];
|
||||
|
||||
return tempDiv.textContent;
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user