- Timestamp:
- 11/19/2010 06:16:03 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-ms-sites-list-table.php
r16438 r16489 55 55 } elseif ( preg_match('/^[0-9]+\./', $s) ) { 56 56 // IP address 57 $reg_blog_ids = $wpdb->get_col( "SELECT blog_id FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.IP LIKE ( '{$like_s}$wild' )" ); 58 59 if ( !$reg_blog_ids ) 60 $reg_blog_ids = array( 0 ); 61 57 62 $query = "SELECT * 58 FROM {$wpdb->blogs} , {$wpdb->registration_log}63 FROM {$wpdb->blogs} 59 64 WHERE site_id = '{$wpdb->siteid}' 60 AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id 61 AND {$wpdb->registration_log}.IP LIKE ( '{$like_s}$wild' )"; 65 AND {$wpdb->blogs}.blog_id IN (" . implode( ', ', $reg_blog_ids ) . ")"; 62 66 } else { 63 if ( is_subdomain_install() ) { 67 if ( is_numeric($s) ) { 68 $query .= " AND ( {$wpdb->blogs}.blog_id = '{$like_s}' )"; 69 } elseif ( is_subdomain_install() ) { 64 70 $blog_s = str_replace( '.' . $current_site->domain, '', $like_s ); 65 71 $blog_s .= $wild . '.' . $current_site->domain; 66 $query .= " AND ( {$wpdb->blogs}.domain LIKE '$blog_s' ";72 $query .= " AND ( {$wpdb->blogs}.domain LIKE '$blog_s' ) "; 67 73 } else { 68 74 if ( $like_s != trim('/', $current_site->path) ) … … 70 76 else 71 77 $blog_s = $like_s; 72 $query .= " AND ( {$wpdb->blogs}.path LIKE '$blog_s' ";78 $query .= " AND ( {$wpdb->blogs}.path LIKE '$blog_s' )"; 73 79 } 74 75 if ( is_numeric($s) )76 $query .= " OR {$wpdb->blogs}.blog_id = '{$like_s}' ";77 78 $query .= ' )';79 80 } 80 81 … … 87 88 $query .= ' ORDER BY domain '; 88 89 } else { 89 $order_by = 'id'; 90 $query .= " ORDER BY {$wpdb->blogs}.blog_id "; 91 } 92 93 $order = ( isset( $_REQUEST['order'] ) && 'DESC' == strtoupper( $_REQUEST['order'] ) ) ? "DESC" : "ASC"; 94 $query .= $order; 90 $order_by = null; 91 } 92 93 if ( isset( $order_by ) ) { 94 $order = ( isset( $_REQUEST['order'] ) && 'DESC' == strtoupper( $_REQUEST['order'] ) ) ? "DESC" : "ASC"; 95 $query .= $order; 96 } 95 97 96 98 // Don't do an unbounded count on large networks
Note: See TracChangeset
for help on using the changeset viewer.