diff --git a/wp-includes/class-wp-tax-query.php b/wp-includes/class-wp-tax-query.php index 9bff196f28..b46aede70a 100644 --- a/wp-includes/class-wp-tax-query.php +++ b/wp-includes/class-wp-tax-query.php @@ -623,7 +623,12 @@ class WP_Tax_Query { * matter because `sanitize_term_field()` ignores the $term_id param when the * context is 'db'. */ - $term = "'" . esc_sql( sanitize_term_field( $query['field'], $term, 0, $query['taxonomy'], 'db' ) ) . "'"; + $clean_term = sanitize_term_field( $query['field'], $term, 0, $query['taxonomy'], 'db' ); + + // Match sanitization in wp_insert_term(). + $clean_term = wp_unslash( $clean_term ); + + $term = "'" . esc_sql( $clean_term ) . "'"; } $terms = implode( ",", $query['terms'] ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 3745cc060c..e040f0df69 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-39660'; +$wp_version = '4.8-alpha-39662'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.