Weave 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

vanilla/htmlawed

Laravel integration for HTMLawed, a PHP HTML sanitizer and validator. It cleans user-submitted markup, balances tags, filters unsafe attributes and elements, and helps preserve safe formatting in rich text. Useful for sanitizing comments, CMS content, and other untrusted HTML.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Enabling rich-text or HTML input safely: Supports features where users, admins, or integrations submit HTML — comments, support tickets, CMS pages, knowledge-base articles, email templates, CRM notes, partner content imports, and customer-branded portals. The package’s role is to filter/allowlist HTML before storage or raw rendering so product teams can ship these features without introducing stored XSS.
  • Build vs. buy for sanitization: Strongly favors “buy/use an existing sanitizer” over building HTML parsing and XSS prevention in-house. htmLawed is a mature filter, and this package is a Composer-compatible fork, so it can be adopted quickly in a Laravel/PHP codebase. However, the fork’s low adoption (40 stars), unclear NOASSERTION license, and only sporadic maintenance signal make it a dependency-risk decision, not a default strategic choice.
  • Defining trust boundaries by surface: A PM can use this to drive policy decisions: admin-authored HTML may allow broader tags, end-user comments should allow a narrow subset, and imported content should be sanitized before persistence. The package supports configurable filtering, so product can define allowlists per feature rather than applying one global policy.
  • Roadmap unblocking for UGC and content workflows: If the roadmap includes user-generated content, customer email-template editing, CMS migration, or third-party HTML ingestion, a sanitizer is a prerequisite. This package can unblock a short-term release, especially where an existing app already uses htmLawed or needs htmLawed-specific behavior.
  • Security and compliance risk reduction: Sanitization reduces XSS and content-injection risk, but it does not replace content moderation, CSP, output encoding, or authorization. PM should treat it as one control in a broader secure-content strategy.
  • Legacy compatibility decisions: Useful if the product must preserve legacy htmLawed configuration or migrate HTML that was historically processed by htmLawed. It is less compelling for greenfield Laravel features where a maintained, Laravel-native sanitizer is preferable.

When to Consider This Package

  • Consider it when: the team specifically needs htmLawed-compatible filtering, already has htmLawed configuration or legacy content behavior to preserve, needs a Composer-installable fork for a Laravel/PHP app, and can accept a low-activity dependency with legal review. The latest release (v2.2.15) is a routine update of the bundled htmLawed library to 1.2.15; it shows the fork is still receiving some maintenance but does not resolve adoption or licensing concerns.
  • Consider it as a stopgap when: a rich-text or HTML-ingestion feature must ship soon, the sanitizer will be wrapped behind an application service, and the team is prepared to pin the version, add regression tests, monitor security advisories, and revisit the dependency.
  • Look elsewhere when: the product needs an actively maintained, Laravel-native sanitization package; the license must be clearly permissive; the feature is security-critical and long-lived; or the team does not want to own maintenance of a low-adoption fork. The v2.2.15 dependency bump does not change these criteria.
  • Look elsewhere for greenfield work: prefer a maintained allowlist-based sanitizer such as Symfony HtmlSanitizer, mews/purifier/HTMLPurifier, or another actively supported option. htmLawed is capable, but this fork’s adoption and long-term release cadence remain weak.
  • Do not adopt without legal review: NOASSERTION means the package metadata does not declare a recognized license. Do not assume MIT or another permissive license. For a distributed product or SaaS with redistribution implications, legal must confirm obligations.
  • Do not treat it as a complete content-safety solution: It filters HTML; it does not solve moderation, spam, malicious file uploads, URL allowlisting for links/images, CSS injection, or authorization.

How to Pitch It (Stakeholders)

  • Executive summary: This package is a quick way to safely allow HTML input in Laravel/PHP product surfaces, reducing XSS risk for rich-text, CMS, support, and customer-template features. The trade-off is dependency risk: low adoption, unclear licensing, and a maintenance history that is only now showing sporadic activity. The v2.2.15 release is a routine htmLawed dependency bump, not a strategic enhancement. It is reasonable as a short-term or compatibility-driven choice, not as a long-term strategic dependency without ownership.
  • Product framing: It unblocks features that require rendering user- or admin-supplied HTML while letting product define what tags and attributes are allowed per surface. It should be paired with clear content policies, output encoding, CSP, and moderation where relevant.
  • Engineering framing: It is a Composer-compatible fork of htmLawed, not a Laravel-native package. Integrate it behind one application service or validation layer, pin the version, add XSS regression tests, and avoid scattering sanitizer calls across controllers and Blade templates. Confirm license terms before shipping. Review v2.2.15’s htmLawed 1.2.15 update for any upstream behavior changes that affect your allowlist policies.
  • Recommendation: Use it only if htmLawed compatibility or speed is the deciding factor. Otherwise, choose a maintained sanitizer with a clear license and active release cadence. If adopted, assign an owner, document the allowlist policy, and set a review date to reassess alternatives. Treat v2.2.15 as a positive maintenance signal but not as a resolution of the license or adoption risks.
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.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource