URL encode item ID in edit link

This commit is contained in:
jomo 2022-08-06 01:12:47 +02:00
parent c5613e96b7
commit c2133771eb

View file

@ -29,7 +29,7 @@ function renderItems() {
clone.querySelector(".content").textContent = item.content; clone.querySelector(".content").textContent = item.content;
clone.querySelector(".note").textContent = item.note; clone.querySelector(".note").textContent = item.note;
clone.querySelector(".result").id = `item-${id}`; clone.querySelector(".result").id = `item-${id}`;
clone.querySelector("a").href = `form.html?id=${id}`; clone.querySelector("a").href = `form.html?id=${encodeURIComponent(id)}`;
if (item.hidden) { if (item.hidden) {
clone.querySelector(".result").classList.add('hidden') clone.querySelector(".result").classList.add('hidden')
}; };