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
This commit is contained in:
Dion Hulse 2015-11-09 01:22:28 +00:00
parent 5411447dd3
commit 09ada24c99
2 changed files with 15 additions and 1 deletions

View File

@ -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 );
}
}

View File

@ -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.