WordPress.org

Make WordPress Core

Ticket #10041: 10041-comment.php.patch

File 10041-comment.php.patch, 642 bytes (added by miqrogroove, 7 years ago)

Fixes a mistake and improves style.

  • src/wp-includes/comment.php

     
    483483        protected function get_search_sql( $string, $cols ) {
    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) . ')';
    491494        }