In `WP_Comment_Query::get_search_sql()`, don't double-like-escape.
Props miqrogroove. See #10041. Built from https://develop.svn.wordpress.org/trunk@28720 git-svn-id: http://core.svn.wordpress.org/trunk@28534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4666c1abe2
commit
5219bbbbc9
|
@ -483,9 +483,12 @@ class WP_Comment_Query {
|
||||||
protected function get_search_sql( $string, $cols ) {
|
protected function get_search_sql( $string, $cols ) {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
|
$like = '%' . $wpdb->esc_like( $string ) . '%';
|
||||||
|
|
||||||
$searches = array();
|
$searches = array();
|
||||||
foreach ( $cols as $col )
|
foreach ( $cols as $col ) {
|
||||||
$searches[] = $wpdb->prepare( "$col LIKE %s", $wpdb->esc_like( $string ) );
|
$searches[] = $wpdb->prepare( "$col LIKE %s", $like );
|
||||||
|
}
|
||||||
|
|
||||||
return ' AND (' . implode(' OR ', $searches) . ')';
|
return ' AND (' . implode(' OR ', $searches) . ')';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue