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:
Scott Taylor 2014-06-10 02:20:16 +00:00
parent 4666c1abe2
commit 5219bbbbc9
1 changed files with 5 additions and 2 deletions

View File

@ -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) . ')';
}