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.
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.
DOMSanitizer::HTML|SVG|MATHMLHow can I help you explore Laravel packages today?