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
Dom Sanitizer

Dom Sanitizer Laravel Package

rhukster/dom-sanitizer

PHP 7.3+ DOM/SVG/MathML sanitizer using DOMDocument and DOMPurify-based allowlists. Removes dangerous tags/attributes, with options for namespace/PHP/HTML/XML stripping and output compression. Customize allowed/disallowed tags and attributes.

View on GitHub
Deep Wiki
Context7

rhukster/dom-sanitizer is a fast, MIT-compatible DOM/SVG/MathML sanitizer for PHP 7.3+ that uses DOMDocument to parse markup and strip unsafe elements and attributes. It’s inspired by DOMPurify’s allowlists, making it practical for cleaning untrusted HTML, SVG, or MathML input before storage or rendering.

Tunable via sanitize() options and runtime allow/deny lists, it lets you target the content type (HTML/SVG/MathML) and tighten or relax output rules as needed.

  • HTML, SVG, and MathML modes via DOMSanitizer::HTML|SVG|MATHML
  • Removes dangerous tags/attributes based on curated allowlists
  • Configurable options (namespaces, PHP/HTML/XML tags, output compression)
  • Extend or restrict rules with addAllowed/Disallowed tag/attribute APIs
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport