Merge pull request #19987 from woocommerce/fix/plugin-install-get-proper-plugin-filename

Plugin installer: fix extracting filename from path
This commit is contained in:
Claudiu Lodromanean 2018-05-07 14:37:40 -07:00 committed by GitHub
commit 9e1b8245be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -1087,7 +1087,8 @@ CREATE TABLE {$wpdb->prefix}woocommerce_termmeta (
*/
private static function associate_plugin_file( $plugins, $key ) {
$path = explode( '/', $key );
$plugins[ $path[1] ] = $key;
$filename = end( $path );
$plugins[ $filename ] = $key;
return $plugins;
}