Support » Plugin: Safe SVG » Disable sanitizing or modifying of file contents

  • Resolved jumbo

    (@jumbo)


    First, thanks for this great plugin.

    I pre-sanitize my SVG’s to strip out bad stuff before uploading, but the plugin does its own sanitizing/modification anyway. Is there any flag or filter I can put in a must-use plugin that’ll allow the Safe SVG plugin to just upload the SVG as-is without touching it?

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Daryll Doyle

    (@enshrined)

    Hey @jumbo,

    Glad you like the plugin and I’m happy to hear that you pre-sanitise your SVGs 🙂

    Unfortunately there’s no way to turn off the sanitisation in the plugin as that’s the only reason for it being here.

    If you’d really rather use this plugin over the others out there, it should be a fairly simple job to turn off the sanitisation by unhooking the following code on line 39.

    add_filter( 'wp_handle_upload_prefilter', array( $this, 'check_for_svg' ) );

    Whilst not the best workaround it should do the trick.

    Sorry I can’t help more.

    Regards,
    Daryll

    @enshrined Your proposed workaround works. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable sanitizing or modifying of file contents’ is closed to new replies.