fix(api): 🐛 Correctly sanitize checkbox inputs

This commit is contained in:
Jesse Wierzbinski 2024-11-19 11:32:16 +01:00
parent dc8a64355a
commit bfbaa7ce2c
No known key found for this signature in database

View file

@ -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();
}
},
})