X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/b3ddbea8a296025a672b3c3ddca158dc51ed8080..cd3609994b39a094ff7528b93f55631bb213fd7f:/wp-admin/update.php diff --git a/wp-admin/update.php b/wp-admin/update.php index e529064e..4fdf2064 100644 --- a/wp-admin/update.php +++ b/wp-admin/update.php @@ -134,11 +134,14 @@ if ( isset($_GET['action']) ) { $title = sprintf( __('Installing Plugin from uploaded file: %s'), basename( $file_upload->filename ) ); $nonce = 'plugin-upload'; - $url = add_query_arg(array('package' => $file_upload->filename ), 'update.php?action=upload-plugin'); + $url = add_query_arg(array('package' => $file_upload->id), 'update.php?action=upload-plugin'); $type = 'upload'; //Install plugin type, From Web or an Upload. $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('type', 'title', 'nonce', 'url') ) ); - $upgrader->install( $file_upload->package ); + $result = $upgrader->install( $file_upload->package ); + + if ( $result || is_wp_error($result) ) + $file_upload->cleanup(); include(ABSPATH . 'wp-admin/admin-footer.php'); @@ -149,8 +152,8 @@ if ( isset($_GET['action']) ) { check_admin_referer('upgrade-theme_' . $theme); - add_thickbox(); - wp_enqueue_script('theme-preview'); + wp_enqueue_script( 'customize-loader' ); + $title = __('Update Theme'); $parent_file = 'themes.php'; $submenu_file = 'themes.php'; @@ -196,13 +199,13 @@ if ( isset($_GET['action']) ) { include_once ABSPATH . 'wp-admin/includes/theme-install.php'; //for themes_api.. check_admin_referer('install-theme_' . $theme); - $api = themes_api('theme_information', array('slug' => $theme, 'fields' => array('sections' => false) ) ); //Save on a bit of bandwidth. + $api = themes_api('theme_information', array('slug' => $theme, 'fields' => array('sections' => false, 'tags' => false) ) ); //Save on a bit of bandwidth. if ( is_wp_error($api) ) wp_die($api); - add_thickbox(); - wp_enqueue_script('theme-preview'); + wp_enqueue_script( 'customize-loader' ); + $title = __('Install Themes'); $parent_file = 'themes.php'; $submenu_file = 'themes.php'; @@ -227,20 +230,24 @@ if ( isset($_GET['action']) ) { $file_upload = new File_Upload_Upgrader('themezip', 'package'); + wp_enqueue_script( 'customize-loader' ); + $title = __('Upload Theme'); $parent_file = 'themes.php'; $submenu_file = 'theme-install.php'; - add_thickbox(); - wp_enqueue_script('theme-preview'); + require_once(ABSPATH . 'wp-admin/admin-header.php'); $title = sprintf( __('Installing Theme from uploaded file: %s'), basename( $file_upload->filename ) ); $nonce = 'theme-upload'; - $url = add_query_arg(array('package' => $file_upload->filename), 'update.php?action=upload-theme'); + $url = add_query_arg(array('package' => $file_upload->id), 'update.php?action=upload-theme'); $type = 'upload'; //Install plugin type, From Web or an Upload. $upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('type', 'title', 'nonce', 'url') ) ); - $upgrader->install( $file_upload->package ); + $result = $upgrader->install( $file_upload->package ); + + if ( $result || is_wp_error($result) ) + $file_upload->cleanup(); include(ABSPATH . 'wp-admin/admin-footer.php');