WordPress.org

Make WordPress Core

Changeset 48565


Ignore:
Timestamp:
07/22/2020 12:54:22 PM (2 months ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Don't trigger database upgrade on Ajax requests via wp-admin/async-upload.php.

Props schlessera, jgrodel, elrae, davidbaumwald, hareesh-pillai, adamsilverstein, SergeyBiryukov.
Fixes #39459.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/admin.php

    r47855 r48565  
    4848    do_action( 'after_db_upgrade' );
    4949
    50 } elseif ( (int) get_option( 'db_version' ) !== $wp_db_version && empty( $_POST ) ) {
     50} elseif ( ! wp_doing_ajax() && empty( $_POST )
     51    && (int) get_option( 'db_version' ) !== $wp_db_version
     52) {
    5153
    5254    if ( ! is_multisite() ) {
     
    261263        }
    262264
    263         if ( ! ( file_exists( WP_PLUGIN_DIR . "/$plugin_page" ) && is_file( WP_PLUGIN_DIR . "/$plugin_page" ) ) && ! ( file_exists( WPMU_PLUGIN_DIR . "/$plugin_page" ) && is_file( WPMU_PLUGIN_DIR . "/$plugin_page" ) ) ) {
     265        if ( ! ( file_exists( WP_PLUGIN_DIR . "/$plugin_page" ) && is_file( WP_PLUGIN_DIR . "/$plugin_page" ) )
     266            && ! ( file_exists( WPMU_PLUGIN_DIR . "/$plugin_page" ) && is_file( WPMU_PLUGIN_DIR . "/$plugin_page" ) )
     267        ) {
    264268            /* translators: %s: Admin page generated by a plugin. */
    265269            wp_die( sprintf( __( 'Cannot load %s.' ), htmlentities( $plugin_page ) ) );
Note: See TracChangeset for help on using the changeset viewer.