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:
Scott Taylor 2014-06-10 02:19:30 +00:00
parent a66f776684
commit ce59109919

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