Make WordPress Core

Changeset 42212 for branches/4.9


Ignore:
Timestamp:
11/21/2017 03:42:48 AM (7 years ago)
Author:
dd32
Message:

Multisite: Fix broken update blog_versions query after [41661].

Props Mista-Flo, lenasterg, flixos90.
Merges [42210] to the 4.9 branch.
Fixes #42641.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/includes/upgrade.php

    r41963 r42212  
    436436        $site_id = get_current_blog_id();
    437437
    438         if ( $wpdb->get_row( $wpdb->prepare( 'SELECT blog_id FROM %s WHERE blog_id = %d', $wpdb->blog_versions, $site_id ) ) ) {
    439             $wpdb->query( $wpdb->prepare( 'UPDATE %s SET db_version = %d WHERE blog_id = %d', $wpdb->blog_versions, $wp_db_version, $site_id ) );
    440         } else {
    441             $wpdb->query( $wpdb->prepare( 'INSERT INTO %s ( `blog_id` , `db_version` , `last_updated` ) VALUES ( %d, %d, %s);', $wpdb->blog_versions, $site_id, $wp_db_version, NOW() ) );
    442         }
     438        if ( $wpdb->get_row( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->blog_versions} WHERE blog_id = %d", $site_id ) ) ) {
     439            $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->blog_versions} SET db_version = %d WHERE blog_id = %d", $wp_db_version, $site_id ) );
     440        } else {
     441            $wpdb->query( $wpdb->prepare( "INSERT INTO {$wpdb->blog_versions} ( `blog_id` , `db_version` , `last_updated` ) VALUES ( %d, %d, NOW() );", $site_id, $wp_db_version ) );
     442        }
    443443    }
    444444
Note: See TracChangeset for help on using the changeset viewer.