diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 4bf48a93d6..22b2e8615c 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -587,7 +587,7 @@ function get_objects_in_term( $term_ids, $taxonomies, $args = array() ) { $term_ids = array_map('intval', $term_ids ); - $taxonomies = "'" . implode( "', '", $taxonomies ) . "'"; + $taxonomies = "'" . implode( "', '", array_map( 'esc_sql', $taxonomies ) ) . "'"; $term_ids = "'" . implode( "', '", $term_ids ) . "'"; $object_ids = $wpdb->get_col("SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ($taxonomies) AND tt.term_id IN ($term_ids) ORDER BY tr.object_id $order"); @@ -1346,7 +1346,7 @@ function get_terms($taxonomies, $args = '') { if ( '' !== $order && !in_array( $order, array( 'ASC', 'DESC' ) ) ) $order = 'ASC'; - $where = "tt.taxonomy IN ('" . implode("', '", $taxonomies) . "')"; + $where = "tt.taxonomy IN ('" . implode("', '", array_map( 'esc_sql', $taxonomies ) ) . "')"; $inclusions = ''; if ( ! empty( $include ) ) { $exclude = ''; @@ -2029,7 +2029,7 @@ function wp_get_object_terms($object_ids, $taxonomies, $args = array()) { if ( '' !== $order && ! in_array( $order, array( 'ASC', 'DESC' ) ) ) $order = 'ASC'; - $taxonomies = "'" . implode("', '", $taxonomies) . "'"; + $taxonomies = "'" . implode("', '", array_map( 'esc_sql', $taxonomies ) ) . "'"; $object_ids = implode(', ', $object_ids); $select_this = '';