mirror of
https://github.com/pi-hole/web.git
synced 2026-04-22 17:59:20 +01:00
Fix html escaping showing up in input fields. (#1584)
Signed-off-by: thislooksfun <thislooksfun@repbot.org>
This commit is contained in:
@@ -22,6 +22,20 @@ function escapeHtml(text) {
|
||||
});
|
||||
}
|
||||
|
||||
function unescapeHtml(text) {
|
||||
var map = {
|
||||
"&": "&",
|
||||
"<": "<",
|
||||
">": ">",
|
||||
""": '"',
|
||||
"'": "'"
|
||||
};
|
||||
|
||||
return text.replace(/&(?:amp|lt|gt|quot|#039);/g, function (m) {
|
||||
return map[m];
|
||||
});
|
||||
}
|
||||
|
||||
// Helper function for converting Objects to Arrays after sorting the keys
|
||||
function objectToArray(obj) {
|
||||
var arr = [];
|
||||
@@ -233,6 +247,7 @@ function getGraphType() {
|
||||
window.utils = (function () {
|
||||
return {
|
||||
escapeHtml: escapeHtml,
|
||||
unescapeHtml: unescapeHtml,
|
||||
objectToArray: objectToArray,
|
||||
padNumber: padNumber,
|
||||
showAlert: showAlert,
|
||||
|
||||
Reference in New Issue
Block a user