tgalopin/html-sanitizer
tgalopin/html-sanitizer is a PHP library for cleaning untrusted HTML safely. It removes dangerous markup to prevent XSS while letting you configure allowed tags, attributes, and extensions, making it easy to display user-generated content securely.
Architecture fit
sanitize(string): string-shaped contract) with no framework coupling in the core. That makes it a natural fit as a boundary component: one place in the request/response pipeline where untrusted markup is normalized before storage or render.Integration feasibility
masterminds/html5 parser dependency is the largest transitive risk: the sanitizer's robustness is inherited from that parser, not from the sanitizer itself.Technical risk
Key questions
Stack fit
sanitize(string, Policy): string) that the rest of the codebase depends on. Do not let application code instantiate the sanitizer directly — the interface is what makes the eventual swap to the maintained successor a one-file change.{!! !!} usage is paired with an explicit, reviewed justification.Migration path
Compatibility
masterminds/html5 and any other dependencies — the transitive tree is where archived-package surprises live.Sequencing
Maintenance
Support
Scaling
Failure modes
Ramp-up
How can I help you explore Laravel packages today?