From 39a19e1d76858122483e8356fe06ec4414a105de 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: http://core.svn.wordpress.org/trunk@23179 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 )