diff --git wp-admin/includes/class-wp-upgrader.php wp-admin/includes/class-wp-upgrader.php
index ef8fb5f..94afe34 100644
|
|
class Plugin_Upgrader extends WP_Upgrader { |
580 | 580 | if ( empty($plugin) ) |
581 | 581 | return false; |
582 | 582 | |
583 | | $pluginfiles = array_keys($plugin); //Assume the requested plugin is the first in the list |
| 583 | $pluginfiles = array_keys($plugin); |
| 584 | |
| 585 | usort( $pluginfiles, array( $this, '_plugin_info_sort_comparison' ) ); |
584 | 586 | |
585 | 587 | return $this->result['destination_name'] . '/' . $pluginfiles[0]; |
586 | 588 | } |
587 | 589 | |
| 590 | /** |
| 591 | * Internal function for comparing paths to sort plugin files in no directory to the top. |
| 592 | * |
| 593 | * @param string $plugin_file_a |
| 594 | * @param string $plugin_file_b |
| 595 | * @return int |
| 596 | */ |
| 597 | function _plugin_info_sort_comparison( $plugin_file_a, $plugin_file_b ) { |
| 598 | return strstr( $plugin_file_a, '/' ) ? 1 : -1; |
| 599 | } |
| 600 | |
588 | 601 | //Hooked to pre_install |
589 | 602 | function deactivate_plugin_before_upgrade($return, $plugin) { |
590 | 603 | |