Prepare some LIKEs

git-svn-id: http://svn.automattic.com/wordpress/trunk@17997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2011-05-22 23:22:59 +00:00
parent cb44c14449
commit bde9c01453
1 changed files with 5 additions and 3 deletions

View File

@ -1284,8 +1284,10 @@ function &get_terms($taxonomies, $args = '') {
$where .= " AND t.slug = '$slug'"; $where .= " AND t.slug = '$slug'";
} }
if ( !empty($name__like) ) if ( !empty($name__like) ) {
$where .= " AND t.name LIKE '" . like_escape( $name__like ) . "%'"; $name__like = like_escape( $name__like );
$where .= $wpdb->prepare( " AND t.name LIKE %s", $name__like . '%' );
}
if ( '' !== $parent ) { if ( '' !== $parent ) {
$parent = (int) $parent; $parent = (int) $parent;
@ -1307,7 +1309,7 @@ function &get_terms($taxonomies, $args = '') {
if ( !empty($search) ) { if ( !empty($search) ) {
$search = like_escape($search); $search = like_escape($search);
$where .= " AND (t.name LIKE '%$search%')"; $where .= $wpdb->prepare( " AND (t.name LIKE %s)", '%' . $search . '%');
} }
$selects = array(); $selects = array();