From 09ada24c9906e246ac41f2ad984cbd23beed7dcf Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 9 Nov 2015 01:22:28 +0000 Subject: [PATCH] Upgrade: Force disable the rest-api plugin on upgrade to 4.4 unless it's beta5+. Previous versions of the plugin were not configured correctly to gradefully degrade during update which would cause fatal errors. Props wonderboymusic. Fixes #34415 Built from https://develop.svn.wordpress.org/trunk@35582 git-svn-id: http://core.svn.wordpress.org/trunk@35546 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/update-core.php | 14 ++++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index ac1ac37645..1fe98d24d6 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -728,6 +728,7 @@ $_new_bundled_files = array( 'themes/twentythirteen/' => '3.6', 'themes/twentyfourteen/' => '3.8', 'themes/twentyfifteen/' => '4.1', + 'themes/twentysixteen/' => '4.4', ); /** @@ -1072,6 +1073,9 @@ function update_core($from, $to) { // Remove any Genericons example.html's from the filesystem _upgrade_422_remove_genericons(); + // Remove the REST API plugin if its version is Beta 4 or lower + _upgrade_440_force_deactivate_incompatible_plugins(); + // Upgrade DB with separate request /** This filter is documented in wp-admin/includes/update-core.php */ apply_filters( 'update_feedback', __( 'Upgrading database…' ) ); @@ -1286,3 +1290,13 @@ function _upgrade_422_find_genericons_files_in_folder( $directory ) { return $files; } + +/** + * @ignore + * @since 4.4.0 + */ +function _upgrade_440_force_deactivate_incompatible_plugins() { + if ( defined( 'REST_API_VERSION' ) && version_compare( REST_API_VERSION, '2.0-beta4', '<=' ) ) { + deactivate_plugins( array( 'rest-api/plugin.php' ), true ); + } +} diff --git a/wp-includes/version.php b/wp-includes/version.php index ed952fd1b2..5690b02fdc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-beta3-35581'; +$wp_version = '4.4-beta3-35582'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.