From 85d32ce87318a5c3af63e93b3a4233bac8d88b97 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 15 Oct 2013 02:58:07 +0000 Subject: [PATCH] Automatic updates: An error code containing 'do_rollback' can be used to trigger a rollback. This could enable the triggering of a rollback in update_core() in wp-admin/includes/update-core.php. see #22704. git-svn-id: https://develop.svn.wordpress.org/trunk@25782 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-upgrader.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-upgrader.php b/src/wp-admin/includes/class-wp-upgrader.php index b6cfa9bdfd..5e67e78d0b 100644 --- a/src/wp-admin/includes/class-wp-upgrader.php +++ b/src/wp-admin/includes/class-wp-upgrader.php @@ -1305,7 +1305,10 @@ class Core_Upgrader extends WP_Upgrader { $error_code = $result->get_error_code(); // Not all errors are equal. These codes are critical: copy_failed__copy_dir, // mkdir_failed__copy_dir, copy_failed__copy_dir_retry, and disk_full. - if ( false !== strpos( $error_code, '__copy_dir' ) ) + // do_rollback allows for update_core() to trigger a rollback if needed. + if ( false !== strpos( $error_code, 'do_rollback' ) ) + $try_rollback = true; + elseif ( false !== strpos( $error_code, '__copy_dir' ) ) $try_rollback = true; elseif ( 'disk_full' === $error_code ) $try_rollback = true;