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:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
commit30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 (patch)
tree39a02e2aeb21ab5b7923c6f5757d66d55b708912 /wp-admin/includes/class-file-upload-upgrader.php
parentAdding upstream version 6.4.3+dfsg1. (diff)
downloadwordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.tar.xz
wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.zip
Adding upstream version 6.5+dfsg1.upstream/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.' ) );
}