Ticket #30788: 30788.diff
File 30788.diff, 2.2 KB (added by , 10 years ago) |
---|
-
wp-admin/includes/class-wp-media-list-table.php
75 75 if ( !empty( $_GET['attachment-filter'] ) && strpos( $_GET['attachment-filter'], 'post_mime_type:' ) === 0 && wp_match_mime_types( $mime_type, str_replace( 'post_mime_type:', '', $_GET['attachment-filter'] ) ) ) 76 76 $selected = ' selected="selected"'; 77 77 if ( !empty( $num_posts[$mime_type] ) ) 78 $type_links[$mime_type] = '<option value="post_mime_type:' . sanitize_mime_type( $mime_type ) . '"' . $selected . '>' . sprintf( translate_nooped_plural( $label[2], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</option>';78 $type_links[$mime_type] = '<option value="post_mime_type:' . esc_attr( $mime_type ) . '"' . $selected . '>' . sprintf( translate_nooped_plural( $label[2], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</option>'; 79 79 } 80 80 $type_links['detached'] = '<option value="detached"' . ( $this->detached ? ' selected="selected"' : '' ) . '>' . sprintf( _nx( 'Unattached (%s)', 'Unattached (%s)', $total_orphans, 'detached files' ), number_format_i18n( $total_orphans ) ) . '</option>'; 81 81 -
wp-includes/post.php
2478 2478 $wild = '[-._a-z0-9]*'; 2479 2479 2480 2480 foreach ( (array) $wildcard_mime_types as $type ) { 2481 $regex = str_replace( '__wildcard__', $wild, preg_quote( str_replace( '*', '__wildcard__', $type ) ) ); 2482 $patternses[1][$type] = "^$regex$"; 2483 if ( false === strpos($type, '/') ) { 2484 $patternses[2][$type] = "^$regex/"; 2485 $patternses[3][$type] = $regex; 2481 $mimes = array_map( 'trim', explode( ',', $type ) ); 2482 foreach ( $mimes as $mime ) { 2483 $regex = str_replace( '__wildcard__', $wild, preg_quote( str_replace( '*', '__wildcard__', $mime ) ) ); 2484 $patternses[][$type] = "^$regex$"; 2485 if ( false === strpos($type, '/') ) { 2486 $patternses[][$type] = "^$regex/"; 2487 } 2486 2488 } 2487 2489 } 2488 2490 asort( $patternses );