darylldoyle / svg-sanitizer

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

SVG emptied on sanitize #37

Closed AndrassGray closed 4 years ago

AndrassGray commented 4 years ago

So I have an SVG file created as "Export as" in Photoshop CC 2015. Running it through the sanitizer gives the following:

image

Is there anything I could do to catch this ?

Thanks a ton, Andrass

darylldoyle commented 4 years ago

Hi Andrass,

It's hard to say why the sanitiser would be stripping this file without seeing the full thing. Is there any chance you can post it, or send it to me in an email to daryll@enshrined.co.uk so that I can run it through locally and debug?

From what I can see, it should pass validation, but it's possible I had an old version up on the smoke test 😬

darylldoyle commented 4 years ago

Hi @AndrassGray,

Thanks for sending the SVG over. I've seen what the issue is now. You're using data:img/png but currently the sanitiser only allows data:image/png. If you change it to that for a second, it should work. I'll get data:img/ added to the sanitiser to stop this happening again also!

darylldoyle commented 4 years ago

Closed in 19e85021505b29f3055c1f57a620ee4aa5c24113

AndrassGray commented 4 years ago

Cool thing! Thanks a ton, Daryll !