Disallow all text formatting by default.

Removed now redundant <script> filtering.

Signed-off-by: Armored Dragon <publicmail@armoreddragon.com>
This commit is contained in:
Armored Dragon 2024-07-08 11:21:04 -05:00
parent c6d2e567f6
commit 6cf6e6c9ec
No known key found for this signature in database
GPG key ID: C7207ACC3382AD8B

View file

@ -509,12 +509,12 @@ Rectangle {
}
function formatContent(mess) {
var arrow = /\</gi
mess = mess.replace(arrow, "&lt;");
var link = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g;
mess = mess.replace(link, (match) => {return "<a onclick='Window.openUrl("+match+")' href='" + match + "'>" + match + "</a> <a onclick='Window.openUrl("+match+")'>⮺</a>"});
var script_tag = /<script\b[^>]*>/gi;
mess = mess.replace(script_tag, "script");
var newline = /\n/gi;
mess = mess.replace(newline, "<br>");
return mess