aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authortobtoht <tob@featherwallet.org>2026-04-18 08:09:49 +0000
committertobtoht <tob@featherwallet.org>2026-04-18 08:09:49 +0000
commitbb4bc4a77ecf4263311cf7b139cd15be28050d3e (patch)
tree74925f1e8a88a991cec7c6116c9ba9f40c420ea4 /js
parent081848bab0fb2430a4e5650e71b704a9f081bfce (diff)
parent23ec5eb6a1dc61ef72a3ca4c9bb5942cbf60d959 (diff)
downloadmonzero-gui-bb4bc4a77ecf4263311cf7b139cd15be28050d3e.tar.gz
monzero-gui-bb4bc4a77ecf4263311cf7b139cd15be28050d3e.tar.xz
monzero-gui-bb4bc4a77ecf4263311cf7b139cd15be28050d3e.zip
Merge pull request #4577
23ec5eb qml: escape untrusted text in RichText views (selsta)
Diffstat (limited to 'js')
-rw-r--r--js/Utils.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/js/Utils.js b/js/Utils.js
index 9094ca4f..e031c78a 100644
--- a/js/Utils.js
+++ b/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, "&amp;")
+ .replace(/</g, "&lt;")
+ .replace(/>/g, "&gt;")
+ .replace(/"/g, "&quot;");
+}