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

@ -1086,8 +1086,9 @@ CREATE TABLE {$wpdb->prefix}woocommerce_termmeta (
* @param string $key Plugin relative path. Example: woocommerce/woocommerce.php.
*/
private static function associate_plugin_file( $plugins, $key ) {
$path = explode( '/', $key );
$plugins[ $path[1] ] = $key;
$path = explode( '/', $key );
$filename = end( $path );
$plugins[ $filename ] = $key;
return $plugins;
}