[wp-trac] [WordPress Trac] #53100: Unable to upload SVGs even if ALLOW_UNFILTERED_UPLOADS set

WordPress Trac noreply at wordpress.org
Tue Mar 5 09:23:07 UTC 2024


#53100: Unable to upload SVGs even if ALLOW_UNFILTERED_UPLOADS set
--------------------------+------------------------------
 Reporter:  desmith       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Upload        |     Version:  5.7.1
 Severity:  minor         |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by rcreators):

 I tested this and seems to only work if you have added svg in the allowed
 mime type and ALLOW_UNFILTERED_UPLOADS added as well.

 1) only mime-type in theme function: Not working

 {{{
 function cc_mime_types( $mimes ){
   $mimes['svg'] = 'image/svg+xml';
   return $mimes;
 }
 add_filter( 'upload_mimes', 'cc_mime_types' );
 }}}

 2) Only added code in wp-config.php file: Not Working

 {{{
 define('ALLOW_UNFILTERED_UPLOADS', true);
 }}}

 3) Add both into WordPress: Working

 This was actually working before with only adding either option. Now we
 have to add both option. Can anyone check what's changed?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53100#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list