Changeset 57403
- Timestamp:
- 01/30/2024 02:56:06 PM (10 months ago)
- Location:
- branches/5.2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.2
- Property svn:mergeinfo changed
/trunk merged: 57388-57389
- Property svn:mergeinfo changed
-
branches/5.2/src/wp-admin/includes/class-file-upload-upgrader.php
r42343 r57403 69 69 } 70 70 71 if ( 'pluginzip' === $form || 'themezip' === $form ) { 72 $archive_is_valid = false; 73 74 /** This filter is documented in wp-admin/includes/file.php */ 75 if ( class_exists( 'ZipArchive', false ) && apply_filters( 'unzip_file_use_ziparchive', true ) ) { 76 $archive = new ZipArchive(); 77 $archive_is_valid = $archive->open( $file['file'], ZIPARCHIVE::CHECKCONS ); 78 79 if ( true === $archive_is_valid ) { 80 $archive->close(); 81 } 82 } else { 83 require_once ABSPATH . 'wp-admin/includes/class-pclzip.php'; 84 85 $archive = new PclZip( $file['file'] ); 86 $archive_is_valid = is_array( $archive->properties() ); 87 } 88 89 if ( true !== $archive_is_valid ) { 90 wp_delete_file( $file['file'] ); 91 wp_die( __( 'Incompatible Archive.' ) ); 92 } 93 } 94 71 95 $this->filename = $_FILES[ $form ]['name']; 72 96 $this->package = $file['file']; -
branches/5.2/src/wp-admin/includes/schema.php
r44976 r57403 577 577 } 578 578 579 if ( is_array( $value ) ) {580 $value = serialize( $value );581 }582 579 if ( ! empty( $insert ) ) { 583 580 $insert .= ', '; 584 581 } 582 583 $value = maybe_serialize( sanitize_option( $option, $value ) ); 584 585 585 $insert .= $wpdb->prepare( '(%s, %s, %s)', $option, $value, $autoload ); 586 586 } -
branches/5.2/src/wp-admin/update.php
r43571 r57403 146 146 147 147 check_admin_referer( 'plugin-upload' ); 148 149 if ( isset( $_FILES['pluginzip']['name'] ) && ! str_ends_with( strtolower( $_FILES['pluginzip']['name'] ), '.zip' ) ) { 150 wp_die( __( 'Only .zip archives may be uploaded.' ) ); 151 } 148 152 149 153 $file_upload = new File_Upload_Upgrader( 'pluginzip', 'package' ); … … 263 267 264 268 check_admin_referer( 'theme-upload' ); 269 270 if ( isset( $_FILES['themezip']['name'] ) && ! str_ends_with( strtolower( $_FILES['themezip']['name'] ), '.zip' ) ) { 271 wp_die( __( 'Only .zip archives may be uploaded.' ) ); 272 } 265 273 266 274 $file_upload = new File_Upload_Upgrader( 'themezip', 'package' );
Note: See TracChangeset
for help on using the changeset viewer.