forked from Public/monero-gui
qml: escape untrusted text in RichText views
This commit is contained in:
10
js/Utils.js
10
js/Utils.js
@@ -130,3 +130,13 @@ function parseDateStringOrRestoreHeightAsInteger(value) {
|
||||
}
|
||||
return restoreHeight;
|
||||
}
|
||||
|
||||
function htmlEscape(s) {
|
||||
if (s === null || s === undefined)
|
||||
return "";
|
||||
return String(s)
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user