WordPress.org

Make WordPress Core

Changeset 16169


Ignore:
Timestamp:
11/03/2010 07:26:23 PM (10 years ago)
Author:
ryan
Message:

Allow trailing wildcard site searches by appending *. see #15170

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-ms-sites-list-table.php

    r16167 r16169  
    3131
    3232        $s = isset( $_REQUEST['s'] ) ? stripslashes( trim( $_REQUEST[ 's' ] ) ) : '';
     33        $wild = '';
     34        if ( false !== strpos($s, '*') ) {
     35            $wild = '%';
     36            $s = trim($s, '*');
     37        }
     38
    3339        $like_s = esc_sql( like_escape( $s ) );
    3440
     
    5460                WHERE site_id = '{$wpdb->siteid}'
    5561                AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id
    56                 AND {$wpdb->registration_log}.IP LIKE ( '{$like_s}%' )";
     62                AND {$wpdb->registration_log}.IP LIKE ( '{$like_s}$wild' )";
    5763        } else {
    5864            if ( is_subdomain_install() ) {
    5965                $blog_s = str_replace( '.' . $current_site->domain, '', $like_s );
    60                 $blog_s .= '.' . $current_site->domain;
     66                $blog_s .= $wild . '.' . $current_site->domain;
    6167                $query .= " AND ( {$wpdb->blogs}.domain LIKE '$blog_s' ";
    6268            } else {
    6369                if ( $like_s != trim('/', $current_site->path) )
    64                     $blog_s = $current_site->path .= $like_s . '/';
     70                    $blog_s = $current_site->path .= $like_s . $wild . '/';
    6571                else
    6672                    $blog_s = $like_s;
Note: See TracChangeset for help on using the changeset viewer.