Changeset 57393
- Timestamp:
- 01/30/2024 02:34:52 PM (8 months ago)
- Location:
- branches/6.2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.2
- Property svn:mergeinfo changed
/trunk merged: 57388-57389
- Property svn:mergeinfo changed
-
branches/6.2/src/wp-admin/includes/class-file-upload-upgrader.php
r54133 r57393 70 70 } 71 71 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 ) { 91 wp_delete_file( $file['file'] ); 92 wp_die( __( 'Incompatible Archive.' ) ); 93 } 94 } 95 72 96 $this->filename = $_FILES[ $form ]['name']; 73 97 $this->package = $file['file']; -
branches/6.2/src/wp-admin/includes/schema.php
r54891 r57393 595 595 } 596 596 597 if ( is_array( $value ) ) {598 $value = serialize( $value );599 }600 601 597 if ( ! empty( $insert ) ) { 602 598 $insert .= ', '; 603 599 } 600 601 $value = maybe_serialize( sanitize_option( $option, $value ) ); 604 602 605 603 $insert .= $wpdb->prepare( '(%s, %s, %s)', $option, $value, $autoload ); -
branches/6.2/src/wp-admin/update.php
r51475 r57393 154 154 155 155 check_admin_referer( 'plugin-upload' ); 156 157 if ( isset( $_FILES['pluginzip']['name'] ) && ! str_ends_with( strtolower( $_FILES['pluginzip']['name'] ), '.zip' ) ) { 158 wp_die( __( 'Only .zip archives may be uploaded.' ) ); 159 } 156 160 157 161 $file_upload = new File_Upload_Upgrader( 'pluginzip', 'package' ); … … 302 306 303 307 check_admin_referer( 'theme-upload' ); 308 309 if ( isset( $_FILES['themezip']['name'] ) && ! str_ends_with( strtolower( $_FILES['themezip']['name'] ), '.zip' ) ) { 310 wp_die( __( 'Only .zip archives may be uploaded.' ) ); 311 } 304 312 305 313 $file_upload = new File_Upload_Upgrader( 'themezip', 'package' );
Note: See TracChangeset
for help on using the changeset viewer.