Replace all uses of like_escape() with $wpdb->esc_like().

Props miqrogroove.
See #10041.


git-svn-id: https://develop.svn.wordpress.org/trunk@28712 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-06-10 00:43:32 +00:00
parent 2a551f57a4
commit 84ad12b439
19 changed files with 122 additions and 76 deletions
+2 -2
View File
@@ -481,11 +481,11 @@ class WP_Comment_Query {
* @return string
*/
protected function get_search_sql( $string, $cols ) {
$string = esc_sql( like_escape( $string ) );
global $wpdb;
$searches = array();
foreach ( $cols as $col )
$searches[] = "$col LIKE '%$string%'";
$searches[] = $wpdb->prepare( "$col LIKE %s", $wpdb->esc_like( $string ) );
return ' AND (' . implode(' OR ', $searches) . ')';
}