Make WordPress Core


Ignore:
Timestamp:
01/14/2016 08:05:06 PM (9 years ago)
Author:
swissspidy
Message:

Allow searching for 0 throughout the admin.

Fixes #31025.

File:
1 edited

Legend:

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

    r36301 r36302  
    7676        global $status, $plugins, $totals, $page, $orderby, $order, $s;
    7777
    78         wp_reset_vars( array( 'orderby', 'order', 's' ) );
     78        wp_reset_vars( array( 'orderby', 'order' ) );
    7979
    8080        /**
     
    225225        }
    226226
    227         if ( $s ) {
     227        if ( strlen( $s ) ) {
    228228            $status = 'search';
    229229            $plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) );
     
    269269
    270270    /**
    271      * @staticvar string $term
     271     * @global string $s
     272     *
    272273     * @param array $plugin
    273274     * @return bool
    274275     */
    275276    public function _search_callback( $plugin ) {
    276         static $term = null;
    277         if ( is_null( $term ) )
    278             $term = wp_unslash( $_REQUEST['s'] );
     277        global $s;
    279278
    280279        foreach ( $plugin as $value ) {
    281             if ( is_string( $value ) && false !== stripos( strip_tags( $value ), $term ) ) {
     280            if ( is_string( $value ) && false !== stripos( strip_tags( $value ), $s ) ) {
    282281                return true;
    283282            }
Note: See TracChangeset for help on using the changeset viewer.