safe-svg icon indicating copy to clipboard operation
safe-svg copied to clipboard

Add options to disable SVG optimizer and sanitizer

Open EldarAgalarov opened this issue 1 year ago • 2 comments

Is your enhancement related to a problem? Please describe.

Hi. It would be nice to add an option that completely disables the SVG sanitizer when uploading SVG files. Many users, would not want their SVG files to be modified.

Designs

No response

Describe alternatives you've considered

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

EldarAgalarov avatar Jul 24 '23 11:07 EldarAgalarov

@EldarAgalarov that, in general, sounds like a wildly unsafe and potentially insecure approach. As such, I'm not certain that's a scenario that we honestly want to support. That said, I'll leave this issue open to capture any additional community input before determining how best to react to this idea.

jeffpaul avatar Aug 16 '23 16:08 jeffpaul

@jeffpaul

There are risks that such optimizers and sanitizers may break SVG files by adding some visible artifacts.

Many users just want SVG support only without optimizers/sanitizers, i.e. the ability to upload SVG's to the WP media library and be able to display them correctly in Media and in WP posts and pages. Without any forced optimizations and sanitizations.

You can add options that will disable these optimizers/sanitizers for advanced users only by implementing them through WP filters. So by default optimizer and sanitizer will be enabled but if user wants to disable them then he can do it at his own risk.

EldarAgalarov avatar Aug 20 '23 09:08 EldarAgalarov