Ticket #19781: 19781.diff
File 19781.diff, 4.6 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/class-wp-upgrader.php
1124 1124 $this->feedback(implode(' | ', (array)$update_actions)); 1125 1125 } 1126 1126 1127 function header() { 1128 // Nothing, This will be displayed within a iframe. 1129 } 1130 1131 function footer() { 1132 // Nothing, This will be displayed within a iframe. 1133 } 1134 1127 1135 function before() { 1128 1136 if ( $this->upgrader->show_before ) { 1129 1137 echo $this->upgrader->show_before; … … 1459 1467 parent::__construct($args); 1460 1468 } 1461 1469 1470 function header() { 1471 // Nothing, This will be displayed within a iframe. 1472 } 1473 1474 function footer() { 1475 // Nothing, This will be displayed within a iframe. 1476 } 1477 1462 1478 function after() { 1463 1479 1464 1480 $update_actions = array(); -
wp-admin/update.php
6 6 * @subpackage Administration 7 7 */ 8 8 9 if ( ! defined( 'IFRAME_REQUEST' ) && isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'update-selected', 'activate-plugin', 'update-selected-themes' ) ) ) 10 define( 'IFRAME_REQUEST', true ); 9 if ( ! defined( 'IFRAME_REQUEST' ) ) { 10 // Requests directly to this page which are assumed to be within iframes 11 if ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'update-selected', 'activate-plugin', 'update-selected-themes' ) ) ) 12 define( 'IFRAME_REQUEST', true ); 13 // Requests to this page which we iframe from here 14 elseif ( ! empty( $_GET['iframe'] ) && isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'upgrade-plugin', 'upgrade-theme' ) ) ) 15 define( 'IFRAME_REQUEST', true ); 16 } 11 17 12 18 /** WordPress Administration Bootstrap */ 13 19 require_once('./admin.php'); … … 54 60 $title = __('Update Plugin'); 55 61 $parent_file = 'plugins.php'; 56 62 $submenu_file = 'plugins.php'; 57 require_once(ABSPATH . 'wp-admin/admin-header.php');58 63 59 64 $nonce = 'upgrade-plugin_' . $plugin; 60 $url = 'update.php?action=upgrade-plugin& plugin=' . $plugin;65 $url = 'update.php?action=upgrade-plugin&iframe=1&plugin=' . $plugin; 61 66 62 $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact('title', 'nonce', 'url', 'plugin') ) );63 $upgrader->upgrade($plugin);67 if ( ! defined( 'IFRAME_REQUEST') || ! IFRAME_REQUEST ) { 68 require_once(ABSPATH . 'wp-admin/admin-header.php'); 64 69 65 include(ABSPATH . 'wp-admin/admin-footer.php'); 70 echo '<div class="wrap">'; 71 screen_icon('plugins'); 72 echo '<h2>' . $title . '</h2>'; 73 echo "<iframe src='" . wp_nonce_url( $url, $nonce ) . "' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>"; 74 echo '</div>'; 66 75 76 include(ABSPATH . 'wp-admin/admin-footer.php'); 77 78 } else { 79 80 iframe_header(); 81 82 $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact('title', 'nonce', 'url', 'plugin') ) ); 83 $upgrader->upgrade($plugin); 84 85 iframe_footer(); 86 87 } 88 67 89 } elseif ('activate-plugin' == $action ) { 68 90 if ( ! current_user_can('update_plugins') ) 69 91 wp_die(__('You do not have sufficient permissions to update plugins for this site.')); … … 157 179 $title = __('Update Theme'); 158 180 $parent_file = 'themes.php'; 159 181 $submenu_file = 'themes.php'; 160 require_once(ABSPATH . 'wp-admin/admin-header.php');161 162 182 $nonce = 'upgrade-theme_' . $theme; 163 $url = 'update.php?action=upgrade-theme& theme=' . $theme;183 $url = 'update.php?action=upgrade-theme&iframe=1&theme=' . $theme; 164 184 165 $upgrader = new Theme_Upgrader( new Theme_Upgrader_Skin( compact('title', 'nonce', 'url', 'theme') ) );166 $upgrader->upgrade($theme);185 if ( ! defined( 'IFRAME_REQUEST') || ! IFRAME_REQUEST ) { 186 require_once(ABSPATH . 'wp-admin/admin-header.php'); 167 187 168 include(ABSPATH . 'wp-admin/admin-footer.php'); 188 echo '<div class="wrap">'; 189 screen_icon('themes'); 190 echo '<h2>' . $title . '</h2>'; 191 echo "<iframe src='" . wp_nonce_url( $url, $nonce ) . "' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>"; 192 echo '</div>'; 193 194 include(ABSPATH . 'wp-admin/admin-footer.php'); 195 196 } else { 197 198 iframe_header(); 199 200 $upgrader = new Theme_Upgrader( new Theme_Upgrader_Skin( compact('title', 'nonce', 'url', 'theme') ) ); 201 $upgrader->upgrade($theme); 202 203 iframe_footer(); 204 205 } 206 169 207 } elseif ( 'update-selected-themes' == $action ) { 170 208 if ( ! current_user_can( 'update_themes' ) ) 171 209 wp_die( __( 'You do not have sufficient permissions to update themes for this site.' ) );