Update forum_fn.js

This commit is contained in:
Zeroday BYTE 2025-02-28 13:10:41 +07:00 committed by GitHub
parent 3584ef7eca
commit 343e3588ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,6 +4,20 @@
* phpBB3 forum functions
*/
/**
* Escape HTML special characters
*/
function escapeHtml(text) {
var map = {
'&': '&',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#039;'
};
return text.replace(/[&<>"']/g, function(m) { return map[m]; });
}
/**
* Find a member
*/
@ -599,7 +613,7 @@ function parseDocument($container) {
}
if ((text.length && text !== '-') || cell.children().length) {
cell.prepend('<dfn style="display: none;">' + headers[column] + '</dfn>');
cell.prepend('<dfn style="display: none;">' + escapeHtml(headers[column]) + '</dfn>');
} else {
cell.addClass('empty');
}