mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-11-23 14:53:07 +05:00
fix: render API strings as text to prevent XSS
This commit is contained in:
1 parent
f2047b18ba
commit
16308866ce
4 files changed
+32
-17
No files matched your search
@@ -649,6 +649,21 @@ const setValue = (selector, value, parent = undefined) => {
|
||||
}
|
||||
}
|
||||
|
||||
const setTextValue = (selector, value, parent = undefined) => {
|
||||
if (parent === undefined) {
|
||||
parent = document;
|
||||
}
|
||||
|
||||
let items = parent.querySelectorAll(selector);
|
||||
if (!items.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let item of items) {
|
||||
item.textContent = value;
|
||||
}
|
||||
}
|
||||
|
||||
const appendValue = (selector, value, nl = null, parent = undefined) => {
|
||||
if (parent === undefined) {
|
||||
parent = document;
|
||||
|
||||
Reference in new issue
Block a user