symfony-html-sanitizer

Installation
SKILL.md

symfony/html-sanitizer

If the project contains .ddev/config.yaml, prefix every shell command with ddev (full mapping in the symfony skill's references/ddev.md). Examples target Symfony 7.4, 8.0 and newer — verify the installed version before using newer features.

When to use

You're accepting HTML from users (rich-text fields, comments, imported content) and need to strip dangerous markup before storing or rendering.

Replaces

  • ezyang/htmlpurifier (HTMLPurifier)
  • strip_tags() (insufficient — leaves attributes)
  • Custom regex-based "sanitisers" (never trust these)

Install

Installs
2
First Seen
Aug 4, 2026