From 0c9c23936b61071332d00609bb5ffb0a6554a48e Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sat, 15 Dec 2012 03:09:50 +0000 Subject: [PATCH] When copying new bundled themes & plugins, bail early if the distro doesn't include the bundled item. This prevents us from creating an empty directory in the destination when the source doesn't exist. See #22856 git-svn-id: https://develop.svn.wordpress.org/trunk@23179 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/update-core.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 1aeaffee65..700352cf18 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -701,6 +701,10 @@ function update_core($from, $to) { $directory = ('/' == $file[ strlen($file)-1 ]); list($type, $filename) = explode('/', $file, 2); + // Check to see if the bundled items exist before attempting to copy them + if ( ! $wp_filesystem->exists( $from . $distro . 'wp-content/' . $file ) ) + continue; + if ( 'plugins' == $type ) $dest = $wp_filesystem->wp_plugins_dir(); elseif ( 'themes' == $type )