From 56d10309d0a20b877d8f50b48b5e02988e3954aa Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 11 Jan 2022 04:12:05 +0000 Subject: [PATCH] Database: Add missing `AS` after `INNER JOIN` in some queries. While `AS` is an optional keyword in SQL, it is commonly considered best practice to include it for better readability and compatibility. This also makes the queries more consistent with other queries using aliases in core. Follow-up to [6359], [30238]. Props costdev, domainsupport. Fixes #54769. Built from https://develop.svn.wordpress.org/trunk@52553 git-svn-id: http://core.svn.wordpress.org/trunk@52143 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 2 +- wp-includes/taxonomy.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 904ec50749..b1ae4e2a35 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -1837,7 +1837,7 @@ function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previo if ( $in_same_term || ! empty( $excluded_terms ) ) { if ( $in_same_term ) { - $join .= " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id"; + $join .= " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id"; $where .= $wpdb->prepare( 'AND tt.taxonomy = %s', $taxonomy ); if ( ! is_object_in_taxonomy( $post->post_type, $taxonomy ) ) { diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index d3d13b5ebd..fbfef11ce8 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -2533,7 +2533,7 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) { * and term_taxonomy_id of the older term instead. Then return out of the function so that the "create" hooks * are not fired. */ - $duplicate_term = $wpdb->get_row( $wpdb->prepare( "SELECT t.term_id, t.slug, tt.term_taxonomy_id, tt.taxonomy FROM $wpdb->terms t INNER JOIN $wpdb->term_taxonomy tt ON ( tt.term_id = t.term_id ) WHERE t.slug = %s AND tt.parent = %d AND tt.taxonomy = %s AND t.term_id < %d AND tt.term_taxonomy_id != %d", $slug, $parent, $taxonomy, $term_id, $tt_id ) ); + $duplicate_term = $wpdb->get_row( $wpdb->prepare( "SELECT t.term_id, t.slug, tt.term_taxonomy_id, tt.taxonomy FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON ( tt.term_id = t.term_id ) WHERE t.slug = %s AND tt.parent = %d AND tt.taxonomy = %s AND t.term_id < %d AND tt.term_taxonomy_id != %d", $slug, $parent, $taxonomy, $term_id, $tt_id ) ); /** * Filters the duplicate term check that takes place during term creation. diff --git a/wp-includes/version.php b/wp-includes/version.php index de20b1337f..5ea294fcb8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-52551'; +$wp_version = '6.0-alpha-52553'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.