Changeset 61028
- Timestamp:
- 10/21/2025 01:40:13 PM (3 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-theme-upgrader.php
r59159 r61028 312 312 } 313 313 314 $ r= $current->response[ $theme ];314 $upgrade_data = $current->response[ $theme ]; 315 315 316 316 add_filter( 'upgrader_pre_install', array( $this, 'current_before' ), 10, 2 ); … … 324 324 $this->run( 325 325 array( 326 'package' => $ r['package'],326 'package' => $upgrade_data['package'], 327 327 'destination' => get_theme_root( $theme ), 328 328 'clear_destination' => true, … … 401 401 402 402 // Connect to the filesystem first. 403 $ res= $this->fs_connect( array( WP_CONTENT_DIR ) );404 if ( ! $ res) {403 $connected = $this->fs_connect( array( WP_CONTENT_DIR ) ); 404 if ( ! $connected ) { 405 405 $this->skin->footer(); 406 406 return false; … … 442 442 443 443 // Get the URL to the zip file. 444 $ r= $current->response[ $theme ];445 446 if ( isset( $ r['requires'] ) && ! is_wp_version_compatible( $r['requires'] ) ) {444 $upgrade_data = $current->response[ $theme ]; 445 446 if ( isset( $upgrade_data['requires'] ) && ! is_wp_version_compatible( $upgrade_data['requires'] ) ) { 447 447 $result = new WP_Error( 448 448 'incompatible_wp_required_version', … … 451 451 __( 'Your WordPress version is %1$s, however the new theme version requires %2$s.' ), 452 452 $wp_version, 453 $ r['requires']453 $upgrade_data['requires'] 454 454 ) 455 455 ); … … 458 458 $this->skin->error( $result ); 459 459 $this->skin->after(); 460 } elseif ( isset( $ r['requires_php'] ) && ! is_php_version_compatible( $r['requires_php'] ) ) {460 } elseif ( isset( $upgrade_data['requires_php'] ) && ! is_php_version_compatible( $upgrade_data['requires_php'] ) ) { 461 461 $result = new WP_Error( 462 462 'incompatible_php_required_version', … … 465 465 __( 'The PHP version on your server is %1$s, however the new theme version requires %2$s.' ), 466 466 PHP_VERSION, 467 $ r['requires_php']467 $upgrade_data['requires_php'] 468 468 ) 469 469 ); … … 476 476 $result = $this->run( 477 477 array( 478 'package' => $ r['package'],478 'package' => $upgrade_data['package'], 479 479 'destination' => get_theme_root( $theme ), 480 480 'clear_destination' => true, … … 590 590 591 591 // All these headers are needed on Theme_Installer_Skin::do_overwrite(). 592 $ info= get_file_data(592 $new_theme_data = get_file_data( 593 593 $working_directory . 'style.css', 594 594 array( … … 602 602 ); 603 603 604 if ( empty( $ info['Name'] ) ) {604 if ( empty( $new_theme_data['Name'] ) ) { 605 605 return new WP_Error( 606 606 'incompatible_archive_theme_no_name', … … 620 620 */ 621 621 if ( 622 empty( $ info['Template'] ) &&622 empty( $new_theme_data['Template'] ) && 623 623 ! file_exists( $working_directory . 'index.php' ) && 624 624 ! file_exists( $working_directory . 'templates/index.html' ) && … … 640 640 } 641 641 642 $requires_php = isset( $ info['RequiresPHP'] ) ? $info['RequiresPHP'] : null;643 $requires_wp = isset( $ info['RequiresWP'] ) ? $info['RequiresWP'] : null;642 $requires_php = isset( $new_theme_data['RequiresPHP'] ) ? $new_theme_data['RequiresPHP'] : null; 643 $requires_wp = isset( $new_theme_data['RequiresWP'] ) ? $new_theme_data['RequiresWP'] : null; 644 644 645 645 if ( ! is_php_version_compatible( $requires_php ) ) { … … 664 664 } 665 665 666 $this->new_theme_data = $ info;666 $this->new_theme_data = $new_theme_data; 667 667 668 668 return $source;
Note: See TracChangeset
for help on using the changeset viewer.