mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
fix(api): 🐛 Correctly sanitize checkbox inputs
This commit is contained in:
parent
dc8a64355a
commit
bfbaa7ce2c
|
|
@ -122,11 +122,10 @@ export const sanitizeHtml = async (
|
|||
// Only allow disabled checkbox input
|
||||
.on("input", {
|
||||
element(element): void {
|
||||
if (
|
||||
element.getAttribute("type") === "checkbox" &&
|
||||
element.getAttribute("disabled") === null
|
||||
) {
|
||||
element.removeAttribute("type");
|
||||
if (element.getAttribute("type") === "checkbox") {
|
||||
element.setAttribute("disabled", "");
|
||||
} else {
|
||||
element.remove();
|
||||
}
|
||||
},
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue