From 8d9c69ffc441681461c01f68464a8b232b31f8df Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 1 Apr 2014 03:36:10 +0000 Subject: [PATCH] Core Updates: Fix a case where options (db_version specifically) can end up with stale values in the cache after a update is performed. Merges [26448] and [26734] from 3.8 to the 3.7 branch. props dd32. fixes #26173. Built from https://develop.svn.wordpress.org/branches/3.7@27885 git-svn-id: http://core.svn.wordpress.org/branches/3.7@27716 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/update-core.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index d466607079..913a9d4cea 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -886,6 +886,11 @@ function update_core($from, $to) { $db_upgrade_url = admin_url('upgrade.php?step=upgrade_db'); wp_remote_post($db_upgrade_url, array('timeout' => 60)); + // Clear the cache to prevent an update_option() from saving a stale db_version to the cache + wp_cache_flush(); + // (Not all cache backends listen to 'flush') + wp_cache_delete( 'alloptions', 'options' ); + // Remove working directory $wp_filesystem->delete($from, true);