diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 5a9eabc239..628d8be978 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -4,6 +4,20 @@ * phpBB3 forum functions */ +/** +* Escape HTML special characters +*/ +function escapeHtml(text) { + var map = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + 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('' + headers[column] + ''); + cell.prepend('' + escapeHtml(headers[column]) + ''); } else { cell.addClass('empty'); }