diff --git src/wp-admin/includes/class-wp-upgrader.php src/wp-admin/includes/class-wp-upgrader.php
index f7dea257ea..3ecf4a258f 100644
|
|
class WP_Upgrader { |
304 | 304 | if ( $wp_filesystem->is_dir($working_dir) ) |
305 | 305 | $wp_filesystem->delete($working_dir, true); |
306 | 306 | |
307 | | // Unzip package to working directory |
308 | | $result = unzip_file( $package, $working_dir ); |
| 307 | $extension = pathinfo($package, PATHINFO_EXTENSION); |
| 308 | if ( $extension == 'zip' ) { |
| 309 | // Unzip package to working directory |
| 310 | $result = unzip_file( $package, $working_dir ); |
309 | 311 | |
310 | | // Once extracted, delete the package if required. |
311 | | if ( $delete_package ) |
312 | | unlink($package); |
| 312 | // Once extracted, delete the package if required. |
| 313 | if ( $delete_package ) |
| 314 | unlink($package); |
| 315 | } else { |
| 316 | // Create a new folder for the PHP file |
| 317 | mkdir($working_dir); |
| 318 | |
| 319 | // Copy the PHP file into the new foler |
| 320 | $result = rename($package, $working_dir . '/' . basename($package)); |
| 321 | } |
313 | 322 | |
314 | 323 | if ( is_wp_error($result) ) { |
315 | 324 | $wp_filesystem->delete($working_dir, true); |