fix broken escapse for <

This commit is contained in:
Danny Tsai 2019-12-21 16:43:36 +08:00 committed by GitHub
parent 7d35f04d61
commit b4a2c63ab4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,7 +103,7 @@ function writeToWebConsole(msg){
var isScrolledDown = document.getElementById("consoleTextArea").scrollHeight - document.getElementById("consoleTextArea").scrollTop - 40 == $("#consoleTextArea").height();
//Write to div, replacing < to &lt; (to avoid XSS) and replacing new line to br.
msg = msg.replace(/</g, "<");
msg = msg.replace(/</g, "&lt;");
msg = msg.replace(/(?:\r\n|\r|\n)/g, "<br>");
//Color filter for Windows (thanks to SuperPykkon)
@ -240,4 +240,4 @@ function updateServerList(){
if(servers.length == 0){
$('#ServerListDropDown').append('<a class="dropdown-item servermenuitem disabled" href="#" id="noServersAdded">No servers added</a>');
}
}
}