Ticket #17816: 17816.diff
File 17816.diff, 3.1 KB (added by , 12 years ago) |
---|
-
wp-admin/includes/class-wp-upgrader.php
915 915 $wp_filesystem->chmod($wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE); 916 916 917 917 require(ABSPATH . 'wp-admin/includes/update-core.php'); 918 /* 919 TODO (@dd32) 920 @nacin, $development_update is to cause $new_bundled_items to be force-updated for development updates 921 Is the following logic the only time needed? What about RC2->Final releases? 922 */ 923 $development_update = ( 'development' == $current->response ); 918 924 919 return update_core($working_dir, $wp_dir );925 return update_core($working_dir, $wp_dir, $development_update); 920 926 } 921 927 922 928 } -
wp-admin/includes/update-core.php
277 277 278 278 $_new_bundled_files = array( 279 279 'plugins/akismet/' => '2.0', 280 'plugins/hello.php' => '2.0', 280 281 'themes/twentyten/' => '3.0', 281 'themes/twentyeleven/' => '3.2' 282 'themes/twentyeleven/' => '3.2', 282 283 ); 283 284 284 285 /** … … 325 326 * 326 327 * @param string $from New release unzipped path. 327 328 * @param string $to Path to old WordPress installation. 329 * @param bool $development_update If this is a -dev update 328 330 * @return WP_Error|null WP_Error on failure, null on success. 329 331 */ 330 function update_core($from, $to ) {332 function update_core($from, $to, $development_update = false ) { 331 333 global $wp_filesystem, $_old_files, $_new_bundled_files, $wpdb; 332 334 333 335 @set_time_limit( 300 ); … … 401 403 if ( !is_wp_error($result) && ( ! defined('CORE_UPGRADE_SKIP_NEW_BUNDLED') || ! CORE_UPGRADE_SKIP_NEW_BUNDLED ) ) { 402 404 $old_version = $GLOBALS['wp_version']; // $wp_version in local scope == new version 403 405 foreach ( (array) $_new_bundled_files as $file => $introduced_version ) { 404 // If $introduced version is greater than what the site was previously running 405 if ( version_compare($introduced_version, $old_version, '>') ) {406 // If $introduced version is greater than what the site was previously running 407 if ( $development_update || version_compare($introduced_version, $old_version, '>') ) { 406 408 $directory = ('/' == $file[ strlen($file)-1 ]); 407 409 list($type, $filename) = explode('/', $file, 2); 408 410 … … 414 416 continue; 415 417 416 418 if ( ! $directory ) { 417 if ( $wp_filesystem->exists($dest . $filename) )418 continue;419 420 419 if ( ! $wp_filesystem->copy($from . $distro . 'wp-content/' . $file, $dest . $filename, FS_CHMOD_FILE) ) 421 420 $result = new WP_Error('copy_failed', __('Could not copy file.'), $dest . $filename); 422 421 } else { 423 if ( $wp_filesystem->is_dir($dest . $filename) )424 continue;425 426 422 $wp_filesystem->mkdir($dest . $filename, FS_CHMOD_DIR); 427 423 $_result = copy_dir( $from . $distro . 'wp-content/' . $file, $dest . $filename); 428 424 if ( is_wp_error($_result) ) //If a error occurs partway through this final step, keep the error flowing through, but keep process going.