Changeset 57537
- Timestamp:
- 02/05/2024 10:21:35 PM (6 months ago)
- Location:
- trunk
- Files:
-
- 15 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-file-upload-upgrader.php
r57388 r57537 71 71 72 72 if ( 'pluginzip' === $form || 'themezip' === $form ) { 73 $archive_is_valid = false; 74 75 /** This filter is documented in wp-admin/includes/file.php */ 76 if ( class_exists( 'ZipArchive', false ) && apply_filters( 'unzip_file_use_ziparchive', true ) ) { 77 $archive = new ZipArchive(); 78 $archive_is_valid = $archive->open( $file['file'], ZIPARCHIVE::CHECKCONS ); 79 80 if ( true === $archive_is_valid ) { 81 $archive->close(); 82 } 83 } else { 84 require_once ABSPATH . 'wp-admin/includes/class-pclzip.php'; 85 86 $archive = new PclZip( $file['file'] ); 87 $archive_is_valid = is_array( $archive->properties() ); 88 } 89 90 if ( true !== $archive_is_valid ) { 73 if ( ! wp_zip_file_is_valid( $file['file'] ) ) { 91 74 wp_delete_file( $file['file'] ); 92 75 wp_die( __( 'Incompatible Archive.' ) ); -
trunk/src/wp-admin/includes/file.php
r57027 r57537 1565 1565 1566 1566 /** 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1567 1598 * Unzips a specified ZIP file to a location on the filesystem via the WordPress 1568 1599 * Filesystem Abstraction.
Note: See TracChangeset
for help on using the changeset viewer.