Ticket #22840: 22840.diff
| File 22840.diff, 3.8 KB (added by , 13 years ago) |
|---|
-
src/wp-admin/includes/class-wp-upgrader.php
424 424 425 425 add_filter('upgrader_source_selection', array($this, 'check_package') ); 426 426 427 $ this->run( array(427 $run_result = $this->run( array( 428 428 'package' => $package, 429 429 'destination' => WP_PLUGIN_DIR, 430 430 'clear_destination' => false, // Do not overwrite files. … … 434 434 435 435 remove_filter('upgrader_source_selection', array($this, 'check_package') ); 436 436 437 if ( ! $run_result || is_wp_error( $run_result ) ) 438 return $run_result; 439 437 440 if ( ! $this->result || is_wp_error($this->result) ) 438 441 return $this->result; 439 442 … … 471 474 add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); 472 475 //'source_selection' => array($this, 'source_selection'), //there's a trac ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins. 473 476 474 $ this->run( array(477 $run_result = $this->run( array( 475 478 'package' => $r->package, 476 479 'destination' => WP_PLUGIN_DIR, 477 480 'clear_destination' => true, … … 485 488 remove_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade')); 486 489 remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); 487 490 491 if ( ! $run_result || is_wp_error( $run_result ) ) 492 return $run_result; 493 488 494 if ( ! $this->result || is_wp_error($this->result) ) 489 495 return $this->result; 490 496 … … 797 803 add_filter('upgrader_source_selection', array($this, 'check_package') ); 798 804 add_filter('upgrader_post_install', array($this, 'check_parent_theme_filter'), 10, 3); 799 805 800 $ this->run( array(806 $run_result = $this->run( array( 801 807 'package' => $package, 802 808 'destination' => get_theme_root(), 803 809 'clear_destination' => false, //Do not overwrite files. … … 807 813 remove_filter('upgrader_source_selection', array($this, 'check_package') ); 808 814 remove_filter('upgrader_post_install', array($this, 'check_parent_theme_filter')); 809 815 816 if ( ! $run_result || is_wp_error( $run_result ) ) 817 return $run_result; 818 810 819 if ( ! $this->result || is_wp_error($this->result) ) 811 820 return $this->result; 812 821 … … 844 853 add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2); 845 854 add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4); 846 855 847 $ this->run( array(856 $run_result = $this->run( array( 848 857 'package' => $r['package'], 849 858 'destination' => get_theme_root( $theme ), 850 859 'clear_destination' => true, … … 858 867 remove_filter('upgrader_post_install', array($this, 'current_after')); 859 868 remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme')); 860 869 870 if ( ! $run_result || is_wp_error( $run_result ) ) 871 return $run_result; 872 861 873 if ( ! $this->result || is_wp_error($this->result) ) 862 874 return $this->result; 863 875 -
src/wp-admin/update.php
140 140 $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('type', 'title', 'nonce', 'url') ) ); 141 141 $result = $upgrader->install( $file_upload->package ); 142 142 143 if ( $result || is_wp_error($result))143 if ( false !== $result ) 144 144 $file_upload->cleanup(); 145 145 146 146 include(ABSPATH . 'wp-admin/admin-footer.php'); … … 246 246 $upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('type', 'title', 'nonce', 'url') ) ); 247 247 $result = $upgrader->install( $file_upload->package ); 248 248 249 if ( $result || is_wp_error($result))249 if ( false !== $result ) 250 250 $file_upload->cleanup(); 251 251 252 252 include(ABSPATH . 'wp-admin/admin-footer.php');
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)