Changeset 57405
- Timestamp:
- 01/30/2024 03:00:56 PM (10 months ago)
- Location:
- branches/5.0
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0
- Property svn:mergeinfo changed
/trunk merged: 57388-57389
- Property svn:mergeinfo changed
-
branches/5.0/src/wp-admin/includes/class-file-upload-upgrader.php
r41289 r57405 64 64 wp_die( $file['error'] ); 65 65 66 if ( 'pluginzip' === $form || 'themezip' === $form ) { 67 $archive_is_valid = false; 68 69 /** This filter is documented in wp-admin/includes/file.php */ 70 if ( class_exists( 'ZipArchive', false ) && apply_filters( 'unzip_file_use_ziparchive', true ) ) { 71 $archive = new ZipArchive(); 72 $archive_is_valid = $archive->open( $file['file'], ZIPARCHIVE::CHECKCONS ); 73 74 if ( true === $archive_is_valid ) { 75 $archive->close(); 76 } 77 } else { 78 require_once ABSPATH . 'wp-admin/includes/class-pclzip.php'; 79 80 $archive = new PclZip( $file['file'] ); 81 $archive_is_valid = is_array( $archive->properties() ); 82 } 83 84 if ( true !== $archive_is_valid ) { 85 wp_delete_file( $file['file'] ); 86 wp_die( __( 'Incompatible Archive.' ) ); 87 } 88 } 89 66 90 $this->filename = $_FILES[$form]['name']; 67 91 $this->package = $file['file']; -
branches/5.0/src/wp-admin/includes/schema.php
r43532 r57405 553 553 $autoload = 'yes'; 554 554 555 if ( is_array($value) )556 $value = serialize($value);557 555 if ( !empty($insert) ) 558 556 $insert .= ', '; 557 558 $value = maybe_serialize( sanitize_option( $option, $value ) ); 559 559 560 $insert .= $wpdb->prepare( "(%s, %s, %s)", $option, $value, $autoload ); 560 561 } -
branches/5.0/src/wp-admin/update.php
r41797 r57405 147 147 check_admin_referer('plugin-upload'); 148 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 } 152 149 153 $file_upload = new File_Upload_Upgrader('pluginzip', 'package'); 150 154 … … 249 253 250 254 check_admin_referer('theme-upload'); 255 256 if ( isset( $_FILES['themezip']['name'] ) && ! str_ends_with( strtolower( $_FILES['themezip']['name'] ), '.zip' ) ) { 257 wp_die( __( 'Only .zip archives may be uploaded.' ) ); 258 } 251 259 252 260 $file_upload = new File_Upload_Upgrader('themezip', 'package');
Note: See TracChangeset
for help on using the changeset viewer.