Changeset 16170
- Timestamp:
- 11/03/2010 07:31:11 PM (14 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-object-query.php
r16168 r16170 228 228 * @param string $string 229 229 * @param array $cols 230 * @param bool $wild Whether to allow trailing wildcard searches. Default is false. 230 231 * @return string 231 232 */ 232 function get_search_sql( $string, $cols ) {233 function get_search_sql( $string, $cols, $wild = false ) { 233 234 $string = esc_sql( $string ); 234 235 235 236 $searches = array(); 237 $wild_char = ( $wild ) ? '%' : ''; 236 238 foreach ( $cols as $col ) { 237 239 if ( 'ID' == $col ) 238 240 $searches[] = "$col = '$string'"; 239 241 else 240 $searches[] = "$col LIKE '$string %'";242 $searches[] = "$col LIKE '$string$wild_char'"; 241 243 } 242 244 -
trunk/wp-includes/user.php
r16168 r16170 447 447 $search = trim( $qv['search'] ); 448 448 if ( $search ) { 449 $wild = false; 450 if ( false !== strpos($search, '*') ) { 451 $wild = 'true'; 452 $search = trim($search, '*'); 453 } 449 454 if ( false !== strpos( $search, '@') ) 450 455 $search_columns[] = array('user_email'); … … 456 461 $search_columns = array('user_login', 'user_nicename', 'display_name'); 457 462 458 $this->query_where .= $this->get_search_sql( $search, $search_columns );463 $this->query_where .= $this->get_search_sql( $search, $search_columns, $wild ); 459 464 } 460 465
Note: See TracChangeset
for help on using the changeset viewer.