Ticket #15866: 15866.2.diff
| File 15866.2.diff, 3.9 KB (added by nacin, 3 years ago) |
|---|
-
wp-admin/network/menu.php
61 61 $update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : ''; 62 62 63 63 $menu[30] = array(sprintf( __('Updates %s'), "<span class='update-plugins count-$update_count' title='$update_title'><span class='update-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'manage_network', 'upgrade.php', '', 'menu-top menu-icon-tools', 'menu-update', 'div'); 64 $submenu[ 'upgrade.php' ][10] = array( __( 'Updates' ), ' install_plugins', 'update-core.php' );64 $submenu[ 'upgrade.php' ][10] = array( __( 'Updates' ), 'update_core', 'update-core.php' ); 65 65 $submenu[ 'upgrade.php' ][15] = array( __( 'Update Network' ), 'manage_network', 'upgrade.php' ); 66 66 unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_count, $update_title, $update_themes, $update_plugins, $update_wordpress); 67 67 -
wp-admin/menu.php
51 51 52 52 $update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : ''; 53 53 54 $submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-$update_count' title='$update_title'><span class='update-count'>" . number_format_i18n($update_count) . "</span></span>" ), ' install_plugins', 'update-core.php');54 $submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-$update_count' title='$update_title'><span class='update-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'update_core', 'update-core.php'); 55 55 unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_count, $update_title, $update_themes, $update_plugins, $update_wordpress); 56 56 } 57 57 -
wp-admin/update-core.php
14 14 exit(); 15 15 } 16 16 17 if ( ! current_user_can( 'update_ plugins' ) )17 if ( ! current_user_can( 'update_core' ) ) 18 18 wp_die( __( 'You do not have sufficient permissions to update this site.' ) ); 19 19 20 20 function list_core_update( $update ) { … … 164 164 echo '<p>' . __( 'While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.' ) . '</p>'; 165 165 dismissed_updates(); 166 166 167 list_plugin_updates(); 168 list_theme_updates(); 167 if ( current_user_can( 'update_plugins' ) ) 168 list_plugin_updates(); 169 if ( current_user_can( 'update_themes' ) ) 170 list_theme_updates(); 169 171 do_action('core_upgrade_preamble'); 170 172 echo '</div>'; 171 173 } … … 406 408 ); 407 409 408 410 if ( 'upgrade-core' == $action ) { 411 409 412 wp_version_check(); 410 413 require_once(ABSPATH . 'wp-admin/admin-header.php'); 411 414 core_upgrade_preamble(); 415 412 416 } elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) { 413 417 check_admin_referer('upgrade-core'); 414 418 … … 429 433 do_core_upgrade($reinstall); 430 434 431 435 } elseif ( 'do-plugin-upgrade' == $action ) { 436 437 if ( ! current_user_can( 'update_plugins' ) ) 438 wp_die( __( 'You do not have sufficient permissions to update this site.' ) ); 439 432 440 check_admin_referer('upgrade-core'); 433 441 434 442 if ( isset( $_GET['plugins'] ) ) { … … 451 459 echo '<h2>' . esc_html__('Update Plugins') . '</h2>'; 452 460 echo "<iframe src='$url' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>"; 453 461 echo '</div>'; 462 454 463 } elseif ( 'do-theme-upgrade' == $action ) { 464 465 if ( ! current_user_can( 'update_themes' ) ) 466 wp_die( __( 'You do not have sufficient permissions to update this site.' ) ); 467 455 468 check_admin_referer('upgrade-core'); 456 469 457 470 if ( isset( $_GET['themes'] ) ) {