enshrined/svg-sanitize
PHP SVG/XML sanitizer inspired by DOMPurify. Clean untrusted SVGs with a simple sanitize() call, optional custom tag/attribute whitelists, remote reference stripping to prevent leaks, issue reporting, and output minification. Returns clean XML or false on parse errors.
Resolved an issue where attribute name case inconsistencies (e.g., xlink:Href instead of xlink:href) in XML processing could cause namespace lookups and sanitisation to fail. Attribute names in both namespaced and non-namespaced contexts are now normalised to their expected lowercase form before processing. This ensures consistent sanitisation of xlink:href and other targeted attributes regardless of their original case.
Full Changelog: https://github.com/darylldoyle/svg-sanitizer/compare/0.21.0...0.22.0
Props @ohader and @realazizk
How can I help you explore Laravel packages today?