• Resolved bpisystems

    (@bpisystems)


    Update the WP install to 4.7.1 yesterday.

    Today, went in to upload a modified SVG file for use on the site. WP is throwing an error stating:

    “Sorry, this file type is not permitted for security reasons.”

    I’ve DELETED the plugin, reinstalled, and tested again with the same results.

    This feels more like an issue brought on by the WP update than with the plugin though I have no way to TS the issue.

    The current SVGs on the site display normally. I used scp to drop in an updated version of an existing file into wp-content. While it displays on the admin side, the page itself fails to display the svg image.

    Hope that helps to narrow down where this might be going sideways.

Viewing 15 replies - 16 through 30 (of 49 total)
  • Thread Starter bpisystems

    (@bpisystems)

    Great process to use Git for repo of sites. I do so little on web side to have thought about it, but color me inspired!

    Actually, wp_get_image_mime() should probably not be used to validate svg at all…

    Neither functions in that are actually able to correctly determine that its an svg.

    Both getimagesize and exif_imagetype dont have a constant for SVG.

    A safe way to fix the issue without compromising security:

    Inside function wp_get_image_mime( $file ), Replace:

    $mime = image_type_to_mime_type( exif_imagetype( $file ) );

    With:

    $exif = exif_imagetype( $file );
    if( ! $exif ){
    	// only fallback on probably ressource intensive method if exif failed
    	$finfo = finfo_open( FILEINFO_MIME_TYPE );
    	$mime = finfo_file( $finfo, $file );
            finfo_close( $finfo );
    } else {
    	$mime = image_type_to_mime_type( $exif );
    }
    • This reply was modified 7 years, 10 months ago by freakpants.
    Plugin Author Benbodhi

    (@benbodhi)

    It’s no surprise that WP core is not focussed on SVG use.
    I will keep digging through the changes to see if I can figure out what I need to do to my plugin to get it working again.

    Thread Starter bpisystems

    (@bpisystems)

    freakpants, will you be submitting a bug report?

    Plugin Author Benbodhi

    (@benbodhi)

    Thanks @freakpants
    Unfortunately, I don’t think this is something that core will necessarily care about since it does not and will not support SVG.
    I think it’s something that plugin devs will have to wear and re-write to work with core.
    It’s doing my head in a bit right now, but I’m sure we’ll get there.

    ps. thanks to all of you for not slamming me as the plugin author saying “Your plugin doesn’t work”, and helping out. Much appreciated!

    Thread Starter bpisystems

    (@bpisystems)

    Awesome.

    Thread Starter bpisystems

    (@bpisystems)

    @benbodhi I’m a little shocked to learn the core team would ignore SVG, but considering the issue isn’t persistent in the alpha 4.8 code base would lead me to presume the devs are taking a step in supporting SVG.

    Thanks for the plug-in and your efforts. It’s a very well laid out GUI, simple documentation, and functional … just what a plug-in should be.

    Plugin Author Benbodhi

    (@benbodhi)

    @bpisystems
    I found after rolling back to 4.7.1, then back to 4.8-alpha the issue persists now… strange.
    I doubt they will include SVG support in core simply because it is XML code and is a security concern, but we can always hope ??
    Would allow me to cull some of my plugin’s code.

    I love your plugin, I HATE the way bitmapped images look at the top of my webpage, so your plugin saved my sanity!

    I have an SVG that has been there and looked great. I got that svg updated tonight and I cannot load it to my media library as others have pointed out: “Sorry, this file type is not permitted for security reasons.”…

    I see from other posts that this is a known problem, I appreciate others pointing it out and your willingness to help us. I hope you can get it worked out soon.

    Take care and thank you for this great plugin!

    Plugin Author Benbodhi

    (@benbodhi)

    Thanks for your support @cain57,
    Maybe you could upload the SVG to your uploads folder via FTP… I haven’t tested, but it could be a work around (possibly).
    EDIT: You can upload via FTP, but it won’t show in your library, you need to know the URL to use in your site.

    • This reply was modified 7 years, 10 months ago by Benbodhi.
    Thread Starter bpisystems

    (@bpisystems)

    @bengodhi … Used scp to move my svg – didn’t work for me as a work around. @freakpants conditional modifier worked perfectly. I’ll need to remember those mods and undo when you have it all sorted out. :-}

    Plugin Author Benbodhi

    (@benbodhi)

    It looks like core will be fixing this issue after all, it is not limited to SVG, but some other file types also. Marked as 4.7.2 release I believe.

    I had this same problem, WP 4.7.1 can not boot normally SVG files. But interestingly, I was updated for a long time, and everything worked, and stopped working just today, I did not updates any WP or plugin.

Viewing 15 replies - 16 through 30 (of 49 total)
  • The topic ‘WP 4.7.1 Kills SVG’ is closed to new replies.