fossar/htmlawed
Fork of kesar/HTMLawed maintained by selfoss and wallabag. A single-file (~45KB) PHP HTML filter/sanitizer that secures and tidies user input, making it standards-compliant for HTML/XHTML/XML, with extensive customization options.
<img/>) mitigates XSS risks in UGC, critical for platforms with untrusted input (e.g., forums, comment sections, or ad networks). Aligns with stricter HTML5 compliance.<details> Element Support: Allows flow content inside <details>, enabling richer interactive UGC (e.g., collapsible FAQs, accordions) without sanitization errors. Expands use cases for educational or support-driven platforms.<details> support into interactive UGC components (e.g., CMS plugins, documentation tools).<br/> or <input/>) and update sanitization rules.<details> for mobile responsiveness).<details>, accordions) or legacy self-closing tags (e.g., <img/>).<details>).<details> or self-closing tags are irrelevant.For Executives: *"This update tightens security and unlocks new UGC features—critical for platforms handling interactive content or legacy HTML snippets. By adopting this package, we can:
<img/>) in user submissions, protecting revenue streams like ads or affiliate links.<details> support, improving engagement for features like FAQs or collapsible guides (e.g., for [Product X]’s help center).For Engineering: *"This release syncs us with upstream HTMLawed 1.2.15, adding two key improvements:
<img/> are now either fixed or removed, reducing XSS surface area. Impact: Test endpoints accepting UGC HTML (e.g., [Endpoint Y]) for edge cases.<details> Flow Content Support: Allows text/nodes inside <details>, enabling interactive UGC. Impact: Update allowed elements in your sanitizer config (e.g., add 'details' to your whitelist).
No Breaking Changes: Pure security/feature updates (PRs #17, #18, #19). Action:composer.json to 1.3.4.<details> works in your interactive UGC components.<br/>).
Pro Tip: Pair with Laravel’s strip_tags() for API responses if you need extra defense-in-depth."*How can I help you explore Laravel packages today?