summaryrefslogtreecommitdiffstats
path: root/wp-admin/includes/class-file-upload-upgrader.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--wp-admin/includes/class-file-upload-upgrader.php19
1 files changed, 1 insertions, 18 deletions
diff --git a/wp-admin/includes/class-file-upload-upgrader.php b/wp-admin/includes/class-file-upload-upgrader.php
index e625615..1201c6d 100644
--- a/wp-admin/includes/class-file-upload-upgrader.php
+++ b/wp-admin/includes/class-file-upload-upgrader.php
@@ -70,24 +70,7 @@ class File_Upload_Upgrader {
}
if ( 'pluginzip' === $form || 'themezip' === $form ) {
- $archive_is_valid = false;
-
- /** This filter is documented in wp-admin/includes/file.php */
- if ( class_exists( 'ZipArchive', false ) && apply_filters( 'unzip_file_use_ziparchive', true ) ) {
- $archive = new ZipArchive();
- $archive_is_valid = $archive->open( $file['file'], ZIPARCHIVE::CHECKCONS );
-
- if ( true === $archive_is_valid ) {
- $archive->close();
- }
- } else {
- require_once ABSPATH . 'wp-admin/includes/class-pclzip.php';
-
- $archive = new PclZip( $file['file'] );
- $archive_is_valid = is_array( $archive->properties() );
- }
-
- if ( true !== $archive_is_valid ) {
+ if ( ! wp_zip_file_is_valid( $file['file'] ) ) {
wp_delete_file( $file['file'] );
wp_die( __( 'Incompatible Archive.' ) );
}