Publicservers user data escape
This commit is contained in:
parent
8625b1bdbf
commit
b28ef7abc5
15
js/main.js
15
js/main.js
|
@ -1004,15 +1004,17 @@ PublicServers.prototype.loadServers = function(dataset, search, clear) {
|
|||
html += '<span class="server-official">Official!</span>';
|
||||
}
|
||||
|
||||
html += '<span class="server-name-span">' + source.name + '</span>';
|
||||
html += '<span class="server-name-span">' + self.escape(source.name) + '</span>';
|
||||
|
||||
var tags = [];
|
||||
source.categories.forEach(function(tag) {
|
||||
tags.push(tag.name);
|
||||
});
|
||||
|
||||
var desc =
|
||||
|
||||
html += '<span class="server-tags">'+tags.join(", ")+'</span>';
|
||||
html += '<span class="server-description">'+(source.description == undefined ? "No Description" : source.description)+'</span>';
|
||||
html += '<span class="server-description">'+(source.description == undefined ? "No Description" : self.escape(source.description)) +'</span>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '<div class="server-info server-members">';
|
||||
|
@ -1107,6 +1109,15 @@ PublicServers.prototype.joinServer = function (code) {
|
|||
$(".create-guild-container input").val(code);
|
||||
$(".form.join-server .btn-primary").click();
|
||||
};
|
||||
|
||||
PublicServers.prototype.escape = function(unsafe) {
|
||||
return unsafe
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
};
|
||||
/* BetterDiscordApp QuickEmoteMenu JavaScript
|
||||
* Version: 1.3
|
||||
* Author: Jiiks | http://jiiks.net
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue