Changeset 48390 for trunk/src/wp-admin/update.php
- Timestamp:
- 07/07/2020 05:47:37 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/update.php
r47808 r48390 158 158 159 159 /* translators: %s: File name. */ 160 $title = sprintf( __( 'Installing Plugin from uploaded file: %s' ), esc_html( basename( $file_upload->filename ) ) );160 $title = sprintf( __( 'Installing plugin from uploaded file: %s' ), esc_html( basename( $file_upload->filename ) ) ); 161 161 $nonce = 'plugin-upload'; 162 162 $url = add_query_arg( array( 'package' => $file_upload->id ), 'update.php?action=upload-plugin' ); 163 163 $type = 'upload'; // Install plugin type, From Web or an Upload. 164 164 165 $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact( 'type', 'title', 'nonce', 'url' ) ) ); 166 $result = $upgrader->install( $file_upload->package ); 165 $overwrite = isset( $_GET['overwrite'] ) ? sanitize_text_field( $_GET['overwrite'] ) : ''; 166 $overwrite = in_array( $overwrite, array( 'update-plugin', 'downgrade-plugin' ), true ) ? $overwrite : ''; 167 168 $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact( 'type', 'title', 'nonce', 'url', 'overwrite' ) ) ); 169 $result = $upgrader->install( $file_upload->package, array( 'overwrite_package' => $overwrite ) ); 167 170 168 171 if ( $result || is_wp_error( $result ) ) { … … 278 281 279 282 /* translators: %s: File name. */ 280 $title = sprintf( __( 'Installing Theme from uploaded file: %s' ), esc_html( basename( $file_upload->filename ) ) );283 $title = sprintf( __( 'Installing theme from uploaded file: %s' ), esc_html( basename( $file_upload->filename ) ) ); 281 284 $nonce = 'theme-upload'; 282 285 $url = add_query_arg( array( 'package' => $file_upload->id ), 'update.php?action=upload-theme' ); 283 286 $type = 'upload'; // Install theme type, From Web or an Upload. 284 287 285 $upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact( 'type', 'title', 'nonce', 'url' ) ) ); 286 $result = $upgrader->install( $file_upload->package ); 288 $overwrite = isset( $_GET['overwrite'] ) ? sanitize_text_field( $_GET['overwrite'] ) : ''; 289 $overwrite = in_array( $overwrite, array( 'update-theme', 'downgrade-theme' ), true ) ? $overwrite : ''; 290 291 $upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact( 'type', 'title', 'nonce', 'url', 'overwrite' ) ) ); 292 $result = $upgrader->install( $file_upload->package, array( 'overwrite_package' => $overwrite ) ); 287 293 288 294 if ( $result || is_wp_error( $result ) ) {
Note: See TracChangeset
for help on using the changeset viewer.