mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 03:04:36 +00:00
Excape HTML (where needed, for bootbox) (references #996)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user