Ticket #13625: 13625.diff
File 13625.diff, 1.9 KB (added by , 15 years ago) |
---|
-
wp-admin/includes/update-core.php
266 266 * @return WP_Error|null WP_Error on failure, null on success. 267 267 */ 268 268 function update_core($from, $to) { 269 global $wp_filesystem, $_old_files, $wpdb ;269 global $wp_filesystem, $_old_files, $wpdb, $wpmu_version; 270 270 271 271 @set_time_limit( 300 ); 272 272 … … 288 288 elseif ( !$mysql_compat ) 289 289 return new WP_Error( 'mysql_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ) ); 290 290 291 if ( isset($wpmu_version) ) 292 $wp_dir = 'wordpress-mu'; 293 else 294 $wp_dir = 'wordpress'; 295 291 296 // Sanity check the unzipped distribution 292 297 apply_filters('update_feedback', __('Verifying the unpacked files…')); 293 if ( !$wp_filesystem->exists($from . '/wordpress/wp-settings.php') || !$wp_filesystem->exists($from . '/wordpress/wp-admin/admin.php') ||294 !$wp_filesystem->exists($from . '/wordpress/wp-includes/functions.php') ) {298 if ( !$wp_filesystem->exists($from . "/$wp_dir/wp-settings.php") || !$wp_filesystem->exists($from . "/$wp_dir/wp-admin/admin.php") || 299 !$wp_filesystem->exists($from . "/$wp_dir/wp-includes/functions.php") ) { 295 300 $wp_filesystem->delete($from, true); 296 301 return new WP_Error('insane_distro', __('The update could not be unpacked') ); 297 302 } … … 305 310 $wp_filesystem->put_contents($maintenance_file, $maintenance_string, FS_CHMOD_FILE); 306 311 307 312 // Copy new versions of WP files into place. 308 $result = copy_dir($from . '/wordpress', $to);313 $result = copy_dir($from . "/$wp_dir", $to); 309 314 if ( is_wp_error($result) ) { 310 315 $wp_filesystem->delete($maintenance_file); 311 316 $wp_filesystem->delete($from, true);