Changeset 57414
- Timestamp:
- 01/30/2024 03:15:17 PM (8 months ago)
- Location:
- branches/4.1
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.1
- Property svn:mergeinfo changed
/trunk merged: 57388-57389
- Property svn:mergeinfo changed
-
branches/4.1/src/wp-admin/includes/class-wp-upgrader.php
r38530 r57414 2293 2293 if ( isset( $file['error'] ) ) 2294 2294 wp_die( $file['error'] ); 2295 2296 if ( 'pluginzip' === $form || 'themezip' === $form ) { 2297 $archive_is_valid = false; 2298 2299 /** This filter is documented in wp-admin/includes/file.php */ 2300 if ( class_exists( 'ZipArchive', false ) && apply_filters( 'unzip_file_use_ziparchive', true ) ) { 2301 $archive = new ZipArchive(); 2302 $archive_is_valid = $archive->open( $file['file'], ZIPARCHIVE::CHECKCONS ); 2303 2304 if ( true === $archive_is_valid ) { 2305 $archive->close(); 2306 } 2307 } else { 2308 require_once ABSPATH . 'wp-admin/includes/class-pclzip.php'; 2309 2310 $archive = new PclZip( $file['file'] ); 2311 $archive_is_valid = is_array( $archive->properties() ); 2312 } 2313 2314 if ( true !== $archive_is_valid ) { 2315 wp_delete_file( $file['file'] ); 2316 wp_die( __( 'Incompatible Archive.' ) ); 2317 } 2318 } 2295 2319 2296 2320 $this->filename = $_FILES[$form]['name']; -
branches/4.1/src/wp-admin/includes/schema.php
r30742 r57414 514 514 $autoload = 'yes'; 515 515 516 if ( is_array($value) )517 $value = serialize($value);518 516 if ( !empty($insert) ) 519 517 $insert .= ', '; 518 519 $value = maybe_serialize( sanitize_option( $option, $value ) ); 520 520 521 $insert .= $wpdb->prepare( "(%s, %s, %s)", $option, $value, $autoload ); 521 522 } -
branches/4.1/src/wp-admin/update.php
r30649 r57414 130 130 check_admin_referer('plugin-upload'); 131 131 132 if ( isset( $_FILES['pluginzip']['name'] ) && ! str_ends_with( strtolower( $_FILES['pluginzip']['name'] ), '.zip' ) ) { 133 wp_die( __( 'Only .zip archives may be uploaded.' ) ); 134 } 135 132 136 $file_upload = new File_Upload_Upgrader('pluginzip', 'package'); 133 137 … … 234 238 235 239 check_admin_referer('theme-upload'); 240 241 if ( isset( $_FILES['themezip']['name'] ) && ! str_ends_with( strtolower( $_FILES['themezip']['name'] ), '.zip' ) ) { 242 wp_die( __( 'Only .zip archives may be uploaded.' ) ); 243 } 236 244 237 245 $file_upload = new File_Upload_Upgrader('themezip', 'package');
Note: See TracChangeset
for help on using the changeset viewer.