fix: render API strings as text to prevent XSS

This commit is contained in:
Yurii committed 2026-10-19 20:05:57 +03:00
1 parent f2047b18ba
commit 16308866ce
4 files changed
+32 -17

No files matched your search

+15
View File
@@ -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;