diff --git a/src/wp-admin/includes/class-plugin-upgrader.php b/src/wp-admin/includes/class-plugin-upgrader.php
index 02743f64561e..56de405edffc 100644
a
|
b
|
public function plugin_info() { |
544 | 544 | } |
545 | 545 | |
546 | 546 | // Assume the requested plugin is the first in the list. |
547 | | $pluginfiles = array_keys( $plugin ); |
| 547 | $pluginfile = array_keys( $plugin )[0]; |
| 548 | |
| 549 | if ( false !== strpos( $pluginfile, '/' ) ) { |
| 550 | // Prefer first top-level file to remain consistent with |
| 551 | // get_plugins() default behavior with WP_PLUGIN_DIR. |
| 552 | foreach ( $plugin as $file => &$data ) { |
| 553 | if ( false === strpos( $file, '/' ) ) { |
| 554 | $pluginfile = $file; |
| 555 | } |
| 556 | } |
| 557 | } |
548 | 558 | |
549 | | return $this->result['destination_name'] . '/' . $pluginfiles[0]; |
| 559 | return $this->result['destination_name'] . '/' . $pluginfile; |
550 | 560 | } |
551 | 561 | |
552 | 562 | /** |