10up / safe-svg

Enable SVG uploads and sanitize them to stop XML/SVG vulnerabilities in your WordPress website.
https://wordpress.org/plugins/safe-svg/
GNU General Public License v2.0
263 stars 31 forks source link

Add option to enable large SVGs #201

Open kirtangajjar opened 3 months ago

kirtangajjar commented 3 months ago

Description of the Change

PR adds support of large SVG files to the plugin. It also adds a setting for it to let the users toggle this behaviour.

How to test the Change

Verify GH action run on this PR and it works properly.

Changelog Entry

Added - Option to enable large SVG file(>10M) upload

Closes #178

Credits

Props @kirtangajjar

Checklist:

github-actions[bot] commented 3 months ago

@kirtangajjar thanks for the PR! Could you please fill out the PR template with description, changelog, and credits information so that we can properly review and merge this?

kirtangajjar commented 3 months ago

@faisal-alvi Thanks for the feedback appreciate it. Even I found that many time we can upload larger files without that flag, but for some files we just are not able to upload them without that flag. i.e. This portrait image won't work without that flag. I found this image in this issue discussion. Many big files would work without the flag. I wasn't able to find any image which causes issue with the toggle on so I kept it on.

https://github.com/10up/safe-svg/assets/8456197/6805e259-26b5-45d1-af71-cbdc7135740c

faisal-alvi commented 3 months ago

I wasn't able to find any image which causes issue with the toggle on so I kept it on.

@kirtangajjar have tried with the https://commons.wikimedia.org/wiki/Category:Large_SVG_files#/media/File:Political_map_of_the_World_(January_2015).svg file? I can reproduce the issue with this SVG file. The issue (as mentioned above) is that I can NOT upload the SVG when "Allow large SVG files" is enabled !? but I can, when it is disabled! I'm ready to connect 1:1 to test and discuss this in detail.

kirtangajjar commented 3 months ago

@faisal-alvi That's really weird. I downloaded the exact same Image and it was working fine for me. Let's connect on it on a week where I have some OSP time.

faisal-alvi commented 2 months ago

Sure @kirtangajjar! Ping me once you are available for a call.