WordPress.org

Make WordPress Core

Changeset 30661


Ignore:
Timestamp:
11/30/2014 08:22:23 PM (5 years ago)
Author:
wonderboymusic
Message:

Use sanitize_mime_type() instead of urlencode() when string-building <option> values in ->get_views() for media list tables.

urlencode() was introduced in [28553] via _duck and yours truly.

Got weirder after [29625].

Props birgire.
Fixes #30123.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-media-list-table.php

    r30154 r30661  
    7676                $selected = ' selected="selected"';
    7777            if ( !empty( $num_posts[$mime_type] ) )
    78                 $type_links[$mime_type] = '<option value="post_mime_type:' . urlencode( $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:' . sanitize_mime_type( $mime_type ) . '"' . $selected . '>' . sprintf( translate_nooped_plural( $label[2], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</option>';
    7979        }
    8080        $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>';
Note: See TracChangeset for help on using the changeset viewer.