Skip to content

[6.x] Sanitize html in html fieldtype#13990

Merged
jasonvarga merged 3 commits into6.xfrom
remove-js-from-html-fieldtype
Feb 18, 2026
Merged

[6.x] Sanitize html in html fieldtype#13990
jasonvarga merged 3 commits into6.xfrom
remove-js-from-html-fieldtype

Conversation

@jasonvarga
Copy link
Member

@jasonvarga jasonvarga commented Feb 18, 2026

This PR adds sanitization to the html fieldtype using the dompurify package.
Technically, by its nature, it would render what you'd tell it. But its a gray area for whether JS should be executable on it.
For safety, it's now sanitized (onerror, onload, etc get stripped out) but I have added an option to opt out, if you actually need them there. At your own risk.

I also made this fieldtype use the composition API since I was in here.

@jasonvarga jasonvarga merged commit 11ae40e into 6.x Feb 18, 2026
14 checks passed
@jasonvarga jasonvarga deleted the remove-js-from-html-fieldtype branch February 18, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments