Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Htmlawed Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Enhanced Security for Self-Closing Tags: Neutralization of illegal self-closing tags (e.g., <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.
  • Improved <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.
  • Roadmap Prioritization Updates:
    • Phase 1 (Expanded): Integrate <details> support into interactive UGC components (e.g., CMS plugins, documentation tools).
    • Phase 2 (Refined): Audit existing UGC pipelines for illegal self-closing tags (e.g., legacy <br/> or <input/>) and update sanitization rules.
    • Phase 3 (Niche): Explore adaptive UGC layouts (e.g., dynamic <details> for mobile responsiveness).
  • Compliance & Risk Mitigation: Proactive handling of self-closing tags reduces edge-case vulnerabilities, particularly for platforms processing third-party HTML snippets (e.g., affiliate widgets or embedded ads).
  • Build vs. Buy: Reinforces the "buy" decision by demonstrating active maintenance and alignment with modern HTML5 features, reducing long-term customization costs.

When to Consider This Package

  • Adopt if:
    • Your app processes user-generated HTML with interactive elements (e.g., <details>, accordions) or legacy self-closing tags (e.g., <img/>).
    • You need strict HTML5 compliance for sanitization, including edge cases like illegal self-closing tags.
    • You rely on upstream HTMLawed and want to avoid forking (this release syncs with latest security/feature updates).
    • Your sanitization rules require fine-grained control over flow content (e.g., allowing text/nodes inside <details>).
  • Look Elsewhere if:
    • You need custom attribute validation logic beyond what upstream supports (e.g., vendor-specific interactive elements).
    • Your use case involves non-standard HTML (e.g., SVG with embedded scripts) where <details> or self-closing tags are irrelevant.
    • You require audit logs for sanitization decisions (this release adds no logging; upstream HTMLawed lacks this feature).
    • You’re locked into a legacy PHP version (<7.4) incompatible with the latest dependencies.

How to Pitch It (Stakeholders)

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:

  • Block XSS risks from malformed self-closing tags (e.g., <img/>) in user submissions, protecting revenue streams like ads or affiliate links.
  • Enable richer UGC with <details> support, improving engagement for features like FAQs or collapsible guides (e.g., for [Product X]’s help center).
  • Reduce support costs by leveraging a maintained, open-source solution instead of custom sanitization logic. The latest release adds critical fixes for illegal tags and expands HTML5 compliance—low effort, high impact. It’s a must-upgrade for our roadmap."*

For Engineering: *"This release syncs us with upstream HTMLawed 1.2.15, adding two key improvements:

  1. Self-Closing Tag Neutralization: Illegal tags like <img/> are now either fixed or removed, reducing XSS surface area. Impact: Test endpoints accepting UGC HTML (e.g., [Endpoint Y]) for edge cases.
  2. <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:
  • Update composer.json to 1.3.4.
  • Verify <details> works in your interactive UGC components.
  • Audit legacy HTML snippets for self-closing tags (e.g., <br/>). Pro Tip: Pair with Laravel’s strip_tags() for API responses if you need extra defense-in-depth."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky