In WP_Comment_Query::get_search_sql()
, don't double-like-escape.
Props miqrogroove. See #10041. git-svn-id: https://develop.svn.wordpress.org/trunk@28720 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a66f776684
commit
ce59109919
@ -483,9 +483,12 @@ class WP_Comment_Query {
|
||||
protected function get_search_sql( $string, $cols ) {
|
||||
global $wpdb;
|
||||
|
||||
$like = '%' . $wpdb->esc_like( $string ) . '%';
|
||||
|
||||
$searches = array();
|
||||
foreach ( $cols as $col )
|
||||
$searches[] = $wpdb->prepare( "$col LIKE %s", $wpdb->esc_like( $string ) );
|
||||
foreach ( $cols as $col ) {
|
||||
$searches[] = $wpdb->prepare( "$col LIKE %s", $like );
|
||||
}
|
||||
|
||||
return ' AND (' . implode(' OR ', $searches) . ')';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user