summaryrefslogtreecommitdiffstats
path: root/wp-admin/includes/class-file-upload-upgrader.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:30 +0000
commitfa9a33d818470a5796f0ff8797f98b510ed8de18 (patch)
treebde6a1eede376f9b5df5898ce812330152984d8e /wp-admin/includes/class-file-upload-upgrader.php
parentReleasing progress-linux version 6.4.3+dfsg1-1~progress7.99u1. (diff)
downloadwordpress-fa9a33d818470a5796f0ff8797f98b510ed8de18.tar.xz
wordpress-fa9a33d818470a5796f0ff8797f98b510ed8de18.zip
Merging upstream version 6.5+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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.' ) );
}