fix: protect against XSS in chat names

This commit is contained in:
Jonathan Rainville 2020-11-05 15:03:53 -05:00 committed by Iuri Matias
parent cd8f49921f
commit dbc1d26966
2 changed files with 6 additions and 3 deletions

View File

@ -57,7 +57,7 @@ ModalPopup {
function doJoin(){
if(pubKeys.length === 0) return;
chatsModel.createGroup(groupName.text, JSON.stringify(pubKeys));
chatsModel.createGroup(Utils.filterXSS(groupName.text), JSON.stringify(pubKeys));
popup.close();
}

View File

@ -54,8 +54,11 @@ QtObject {
var replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim;
replacedText = replacedText.replace(replacePattern2, "$1<a href='http://$2'>$2</a>");
replacedText = XSS.filterXSS(replacedText)
return replacedText;
return XSS.filterXSS(replacedText)
}
function filterXSS(inputText) {
return XSS.filterXSS(inputText)
}
function toLocaleString(val, locale, options) {