Make WordPress Core

Changeset 28720


Ignore:
Timestamp:
06/10/2014 02:19:30 AM (10 years ago)
Author:
wonderboymusic
Message:

In WP_Comment_Query::get_search_sql(), don't double-like-escape.

Props miqrogroove.
See #10041.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment.php

    r28712 r28720  
    484484        global $wpdb;
    485485
     486        $like = '%' . $wpdb->esc_like( $string ) . '%';
     487
    486488        $searches = array();
    487         foreach ( $cols as $col )
    488             $searches[] = $wpdb->prepare( "$col LIKE %s", $wpdb->esc_like( $string ) );
     489        foreach ( $cols as $col ) {
     490            $searches[] = $wpdb->prepare( "$col LIKE %s", $like );
     491        }
    489492
    490493        return ' AND (' . implode(' OR ', $searches) . ')';
Note: See TracChangeset for help on using the changeset viewer.