Commit c3006eab authored by Sergey Biryukov's avatar Sergey Biryukov
Browse files

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.
Built from https://develop.svn.wordpress.org/trunk@48565


git-svn-id: https://core.svn.wordpress.org/trunk@48327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent 2d506d23
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -47,7 +47,9 @@ if ( get_option( 'db_upgraded' ) ) {
	 */
	do_action( 'after_db_upgrade' );

} elseif ( (int) get_option( 'db_version' ) !== $wp_db_version && empty( $_POST ) ) {
} elseif ( ! wp_doing_ajax() && empty( $_POST )
	&& (int) get_option( 'db_version' ) !== $wp_db_version
) {

	if ( ! is_multisite() ) {
		wp_redirect( admin_url( 'upgrade.php?_wp_http_referer=' . urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
@@ -260,7 +262,9 @@ if ( isset( $plugin_page ) ) {
			wp_die( __( 'Invalid plugin page.' ) );
		}

		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" ) ) ) {
		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" ) )
		) {
			/* translators: %s: Admin page generated by a plugin. */
			wp_die( sprintf( __( 'Cannot load %s.' ), htmlentities( $plugin_page ) ) );
		}
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
 *
 * @global string $wp_version
 */
$wp_version = '5.5-beta3-48564';
$wp_version = '5.5-beta3-48565';

/**
 * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.