WordPress.org

Make WordPress Core

Ticket #8991: wp_post_mime_type_where_suffix.diff

File wp_post_mime_type_where_suffix.diff, 623 bytes (added by Sam_a, 7 years ago)

Fixes wp_post_mime_type_where() so it works correctly for mime types like (type/sub+suffix)

  • wp-includes/post.php

     
    10541054                $slashpos = strpos($mime_type, '/'); 
    10551055                if ( false !== $slashpos ) { 
    10561056                        $mime_group = preg_replace('/[^-*.a-zA-Z0-9]/', '', substr($mime_type, 0, $slashpos)); 
    1057                         $mime_subgroup = preg_replace('/[^-*.a-zA-Z0-9]/', '', substr($mime_type, $slashpos + 1)); 
     1057                        $mime_subgroup = preg_replace('/[^-*.+a-zA-Z0-9]/', '', substr($mime_type, $slashpos + 1)); 
    10581058                        if ( empty($mime_subgroup) ) 
    10591059                                $mime_subgroup = '*'; 
    10601060                        else