joomla/filter
Joomla Filter provides input sanitization and filtering utilities for PHP apps. Use InputFilter to allow/block specific HTML tags and attributes, and OutputFilter for safe output helpers like URL-safe strings. Composer installable, lightweight, framework-ready.
strip_tags() usage. Ideal for teams prioritizing security over customization.Adopt if:
e() or strip_tags().<b>, <i>, but block <script>) without managing a custom solution.Look elsewhere if:
Illuminate\Validation\Rules\Sanitize) for simple inputs.HTMLPurifier or DOMDocument), real-time filtering (WebSockets), or JavaScript integration.For Executives: "This package lets us deploy secure, configurable HTML sanitization in Laravel without building or maintaining custom XSS protection. It’s a drop-in solution for high-risk inputs like user comments or CMS content, reducing vulnerabilities while cutting dev time. Joomla’s track record in security (despite low stars) and its focus on filtering make it a pragmatic choice—especially if we’re already using PHP. The tradeoff? Minimal maintenance risk vs. zero active development, but the security upside outweighs that for core features."
For Engineering:
*"The joomla/filter package gives us a battle-tested way to sanitize HTML inputs in Laravel, with fine-grained control over allowed tags/attributes. Key benefits:
Caveats:
Recommendation: Use for critical HTML inputs (e.g., comments, posts) where XSS is a priority, but pair with Laravel’s validation layer for non-HTML fields. Avoid for high-traffic APIs where performance is critical."*
For Security Teams: *"This package addresses A03:2021 Injection (XSS) by providing configurable HTML sanitization with:
<p>, <a href>).javascript:, ', and data: URIs (since v4.0.1).Mitigations for risks:
~4.0) to avoid breaking changes.e() for output escaping and CSRF tokens for forms.How can I help you explore Laravel packages today?