darylldoyle / svg-sanitizer

A PHP SVG/XML Sanitizer
GNU General Public License v2.0
454 stars 67 forks source link

Allow the enable-background attribute #65

Closed Bersman closed 2 weeks ago

Bersman commented 2 years ago

PR for #63

xerc commented 2 years ago

deprecated ; https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/enable-background

ohader commented 2 years ago

deprecated ; https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/enable-background

Sure, but still being used in the wild. It's similar to xlink:href which still is used even it is deprecated (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href).

brianteeman commented 1 year ago

Please merge this

darylldoyle commented 1 year ago

The enable-background attribute has been deprecated from the SVG specification for some time. It only seems to be included in Illustrator exports now for some legacy reason. If it's not being actively used in the SVG (which I assume it's not) then I see no problem removing it. As such I'd rather not add support for it. If support is needed for the attribute, I suggest extending the AllowedAttributes class and using the setAllowedAttrs method on the sanitiser to pass them in prior to running it.