Escape using jquery

Fix #105
This commit is contained in:
Daniel Berteaud 2015-07-21 19:17:06 +02:00
parent 1a054c8c52
commit 64d831f951
1 changed files with 1 additions and 4 deletions

View File

@ -152,10 +152,7 @@ $('#switch_lang').change(function(){
// Escape entities to prevent XSS
function stringEscape(string){
string = string.replace(/[\u00A0-\u99999<>\&]/gim, function(i) {
return '&#' + i.charCodeAt(0) + ';';
});
return string;
return $('<div>').text(string).html();
}
// Select a color (randomly) from this list, used for text chat, and the name under the preview