diff --git a/src/wp-admin/includes/class-plugin-upgrader.php b/src/wp-admin/includes/class-plugin-upgrader.php
index c750399277..14b1c89754 100644
a
|
b
|
class Plugin_Upgrader extends WP_Upgrader { |
496 | 496 | // Assume the requested plugin is the first in the list. |
497 | 497 | $pluginfiles = array_keys( $plugin ); |
498 | 498 | |
| 499 | usort( $pluginfiles, array( $this, '_plugin_info_sort_comparison' ) ); |
| 500 | |
499 | 501 | return $this->result['destination_name'] . '/' . $pluginfiles[0]; |
500 | 502 | } |
501 | 503 | |
| 504 | /** |
| 505 | * Internal function for comparing paths to sort plugin files in no directory to the top. |
| 506 | * |
| 507 | * @param string $plugin_file_a |
| 508 | * @param string $plugin_file_b |
| 509 | * @return int |
| 510 | */ |
| 511 | function _plugin_info_sort_comparison( $plugin_file_a, $plugin_file_b ) { |
| 512 | return strstr( $plugin_file_a, '/' ) ? 1 : -1; |
| 513 | } |
| 514 | |
502 | 515 | /** |
503 | 516 | * Deactivates a plugin before it is upgraded. |
504 | 517 | * |