Symfony HtmlSanitizer
PHP component with an object-oriented API for sanitizing untrusted HTML input before it is inserted into a document.
symfony.com/packages/html-sanitizerrepositorydocs
Symfony HtmlSanitizer is a PHP component that cleans untrusted HTML before it is inserted into a document. It rebuilds the markup from the elements and attributes a configuration allows, and its docs give output from WYSIWYG editors as an example of untrusted input. It is based on the W3C HTML Sanitizer standard proposal.
The Symfony framework exposes the sanitizer as a service. It integrates with Symfony Forms through an option on text fields, and the docs show a Twig filter and a standalone use.
The repository is a read-only split of the main Symfony repository, which takes the issues and pull requests.
Identity
Rendering and deploy
- Install with
- composer3
Releases
Adoption
Sources
- 2026-11-16: links, Categories
symfony.com/packages/html-sanitizer - 2026-11-16: links, Written in, License, GitHub stars
api.github.com/repos/symfony/html-sanitizer - 2026-11-16: links, Install with
symfony.com/doc/current/html_sanitizer.html - 2026-11-16: Runtime, Minimum runtime
github.com/symfony/html-sanitizer/blob/v8.1.11/composer.json - 2026-11-16: Maintainer
github.com/symfony/html-sanitizer/blob/8.2/LICENSE - 2026-11-16: First release
repo.packagist.org/p2/symfony/html-sanitizer.json - 2026-11-16: Current major version
github.com/symfony/html-sanitizer/releases - 2026-11-16: Last release
api.github.com/repos/symfony/html-sanitizer/releases - 2026-11-16: Packagist downloads, Packagist downloads a month
packagist.org/packages/symfony/html-sanitizer.json - 2026-11-16: Contributors
api.github.com/repos/symfony/html-sanitizer/contributors - 2026-11-16: Dependent packages, Dependent repositories
packages.ecosyste.ms/api/v1/registries/packagist.org/packages/symfony/html-sanitizer