Escape using jquery

Fix #105
master
Daniel Berteaud 9 years ago
parent 1a054c8c52
commit 64d831f951
  1. 5
      public/js/vroom.js

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

Loading…
Cancel
Save