WordPress 3.6.1
[autoinstalls/wordpress.git] / wp-admin / includes / update-core.php
index 1aeaffee657ff79bc76a0c34bd27779356c93e0b..ea1312b1329eec1b625b551bb08403230ecf3314 100644 (file)
@@ -535,6 +535,29 @@ $_old_files = array(
 'wp-includes/js/jquery/ui/jquery.effects.pulsate.min.js',
 'wp-includes/js/jquery/ui/jquery.effects.transfer.min.js',
 'wp-includes/js/jquery/ui/jquery.effects.fold.min.js',
+'wp-admin/images/screenshots/captions-1.png',
+'wp-admin/images/screenshots/captions-2.png',
+'wp-admin/images/screenshots/flex-header-1.png',
+'wp-admin/images/screenshots/flex-header-2.png',
+'wp-admin/images/screenshots/flex-header-3.png',
+'wp-admin/images/screenshots/flex-header-media-library.png',
+'wp-admin/images/screenshots/theme-customizer.png',
+'wp-admin/images/screenshots/twitter-embed-1.png',
+'wp-admin/images/screenshots/twitter-embed-2.png',
+'wp-admin/js/utils.js',
+'wp-admin/options-privacy.php',
+'wp-app.php',
+'wp-includes/class-wp-atom-server.php',
+'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css',
+// 3.5.2
+'wp-includes/js/swfupload/swfupload-all.js',
+// 3.6
+'wp-admin/js/revisions-js.php',
+'wp-admin/images/screenshots',
+'wp-admin/js/categories.js',
+'wp-admin/js/categories.min.js',
+'wp-admin/js/custom-fields.js',
+'wp-admin/js/custom-fields.min.js',
 );
 
 /**
@@ -557,10 +580,11 @@ $_old_files = array(
 global $_new_bundled_files;
 
 $_new_bundled_files = array(
-'plugins/akismet/' => '2.0',
-'themes/twentyten/' => '3.0',
-'themes/twentyeleven/' => '3.2',
-'themes/twentytwelve/' => '3.5',
+       'plugins/akismet/'       => '2.0',
+       'themes/twentyten/'      => '3.0',
+       'themes/twentyeleven/'   => '3.2',
+       'themes/twentytwelve/'   => '3.5',
+       'themes/twentythirteen/' => '3.6',
 );
 
 /**
@@ -630,7 +654,8 @@ function update_core($from, $to) {
        }
 
        // Import $wp_version, $required_php_version, and $required_mysql_version from the new version
-       $versions_file = $wp_filesystem->wp_content_dir() . 'upgrade/version-current.php';
+       // $wp_filesystem->wp_content_dir() returned unslashed pre-2.8
+       $versions_file = trailingslashit( $wp_filesystem->wp_content_dir() ) . 'upgrade/version-current.php';
        if ( ! $wp_filesystem->copy( $from . $distro . 'wp-includes/version.php', $versions_file ) ) {
                 $wp_filesystem->delete( $from, true );
                 return new WP_Error( 'copy_failed', __('Could not copy file.') );
@@ -691,6 +716,13 @@ function update_core($from, $to) {
                }
        }
 
+       // 3.5 -> 3.5+ - an empty twentytwelve directory was created upon upgrade to 3.5 for some users, preventing installation of Twenty Twelve.
+       if ( '3.5' == $old_wp_version ) {
+               if ( is_dir( WP_CONTENT_DIR . '/themes/twentytwelve' ) && ! file_exists( WP_CONTENT_DIR . '/themes/twentytwelve/style.css' )  ) {
+                       $wp_filesystem->delete( $wp_filesystem->wp_themes_dir() . 'twentytwelve/' );
+               }
+       }
+
        // Copy New bundled plugins & themes
        // This gives us the ability to install new plugins & themes bundled with future versions of WordPress whilst avoiding the re-install upon upgrade issue.
        // $development_build controls us overwriting bundled themes and plugins when a non-stable release is being updated
@@ -701,6 +733,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 )