From 23ec5eb6a1dc61ef72a3ca4c9bb5942cbf60d959 Mon Sep 17 00:00:00 2001 From: selsta Date: Fri, 17 Apr 2026 18:02:58 +0200 Subject: qml: escape untrusted text in RichText views --- js/Utils.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'js') 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, "&") + .replace(//g, ">") + .replace(/"/g, """); +} -- cgit v1.2.3