Changeset 57410
- Timestamp:
- 01/30/2024 03:10:15 PM (11 months ago)
- Location:
- branches/4.5
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.5
- Property svn:mergeinfo changed
/trunk merged: 57388-57389
- Property svn:mergeinfo changed
-
branches/4.5/src/wp-admin/includes/class-wp-upgrader.php
r38526 r57410 2626 2626 if ( isset( $file['error'] ) ) 2627 2627 wp_die( $file['error'] ); 2628 2629 if ( 'pluginzip' === $form || 'themezip' === $form ) { 2630 $archive_is_valid = false; 2631 2632 /** This filter is documented in wp-admin/includes/file.php */ 2633 if ( class_exists( 'ZipArchive', false ) && apply_filters( 'unzip_file_use_ziparchive', true ) ) { 2634 $archive = new ZipArchive(); 2635 $archive_is_valid = $archive->open( $file['file'], ZIPARCHIVE::CHECKCONS ); 2636 2637 if ( true === $archive_is_valid ) { 2638 $archive->close(); 2639 } 2640 } else { 2641 require_once ABSPATH . 'wp-admin/includes/class-pclzip.php'; 2642 2643 $archive = new PclZip( $file['file'] ); 2644 $archive_is_valid = is_array( $archive->properties() ); 2645 } 2646 2647 if ( true !== $archive_is_valid ) { 2648 wp_delete_file( $file['file'] ); 2649 wp_die( __( 'Incompatible Archive.' ) ); 2650 } 2651 } 2628 2652 2629 2653 $this->filename = $_FILES[$form]['name']; -
branches/4.5/src/wp-admin/includes/schema.php
r36654 r57410 552 552 $autoload = 'yes'; 553 553 554 if ( is_array($value) )555 $value = serialize($value);556 554 if ( !empty($insert) ) 557 555 $insert .= ', '; 556 557 $value = maybe_serialize( sanitize_option( $option, $value ) ); 558 558 559 $insert .= $wpdb->prepare( "(%s, %s, %s)", $option, $value, $autoload ); 559 560 } -
branches/4.5/src/wp-admin/update.php
r34598 r57410 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 … … 251 255 252 256 check_admin_referer('theme-upload'); 257 258 if ( isset( $_FILES['themezip']['name'] ) && ! str_ends_with( strtolower( $_FILES['themezip']['name'] ), '.zip' ) ) { 259 wp_die( __( 'Only .zip archives may be uploaded.' ) ); 260 } 253 261 254 262 $file_upload = new File_Upload_Upgrader('themezip', 'package');
Note: See TracChangeset
for help on using the changeset viewer.