Excape HTML (where needed, for bootbox) (references #996)

This commit is contained in:
Bernd Bestel
2020-09-08 18:10:30 +02:00
parent 22434c85f0
commit 0df2590de2
19 changed files with 32 additions and 24 deletions

View File

@@ -172,10 +172,12 @@ function animateCSS(selector, animationName, callback, speed = "faster")
nodes.on('animationend', handleAnimationEnd);
}
function RandomString()
{
return Math.random().toString(36).substring(2, 100) + Math.random().toString(36).substring(2, 100);
}
function getQRCodeForContent(url)
{
var qr = qrcode(0, 'L');
@@ -183,6 +185,7 @@ function getQRCodeForContent(url)
qr.make();
return qr.createImgTag(10, 5);
}
function getQRCodeForAPIKey(apikey_type, apikey_key)
{
var content = U('/api') + '|' + apikey_key;
@@ -192,3 +195,8 @@ function getQRCodeForAPIKey(apikey_type, apikey_key)
}
return getQRCodeForContent(content);
}
function SanitizeHtml(input)
{
return $("<div/>").text(input).html();
}