Why does SVG upload in Media Library fail if the file does not have an XML tag at the beginning?
I have enabled SVG uploads using this code: add_filter(‘upload_mimes’, function($mimes) { $mimes[‘svg’] = ‘image/svg+xml’; return $mimes; }); However, uploads of SVG files that start with the <svg> tag fail with the usual “Sorry, this file type is not permitted for security reasons.” error that WordPress displays when SVG uploads are not supported. If I add … Read more