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 // Only allow disabled checkbox input
.on("input", { .on("input", {
element(element): void { element(element): void {
if ( if (element.getAttribute("type") === "checkbox") {
element.getAttribute("type") === "checkbox" && element.setAttribute("disabled", "");
element.getAttribute("disabled") === null } else {
) { element.remove();
element.removeAttribute("type");
} }
}, },
}) })