Make WordPress Core

Changeset 18021 for branches/3.1


Ignore:
Timestamp:
05/24/2011 03:55:39 PM (15 years ago)
Author:
ryan
Message:

Prepare some LIKEs

Location:
branches/3.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1

  • branches/3.1/wp-includes/taxonomy.php

    r17527 r18021  
    12561256        }
    12571257
    1258         if ( !empty($name__like) )
    1259                 $where .= " AND t.name LIKE '" . like_escape( $name__like ) . "%'";
     1258        if ( !empty($name__like) ) {
     1259                $name__like = like_escape( $name__like );
     1260                $where .= $wpdb->prepare( " AND t.name LIKE %s", $name__like . '%' );
     1261        }
    12601262
    12611263        if ( '' !== $parent ) {
    … …  
    12791281        if ( !empty($search) ) {
    12801282                $search = like_escape($search);
    1281                 $where .= " AND (t.name LIKE '%$search%')";
     1283                $where .= $wpdb->prepare( " AND (t.name LIKE %s)", '%' . $search . '%');
    12821284        }
    12831285
Note: See TracChangeset for help on using the changeset viewer.