Make WordPress Core

Ticket #31422: network-500-error.patch

File network-500-error.patch, 7.7 KB (added by yo-l1982, 9 years ago)

Patch for this issue.

  • wp-admin/network/index.php

     
    1717        wp_die( __( 'Multisite support is not enabled.' ) );
    1818
    1919if ( ! current_user_can( 'manage_network' ) )
    20         wp_die( __( 'You do not have permission to access this page.' ) );
     20        wp_die( __( 'You do not have permission to access this page.' ), '', array('response' => 403) );
    2121
    2222$title = __( 'Dashboard' );
    2323$parent_file = 'index.php';
  • wp-admin/network/settings.php

     
    1717        wp_die( __( 'Multisite support is not enabled.' ) );
    1818
    1919if ( ! current_user_can( 'manage_network_options' ) )
    20         wp_die( __( 'You do not have permission to access this page.' ) );
     20        wp_die( __( 'You do not have permission to access this page.' ), '', array('response' => 403) );
    2121
    2222$title = __( 'Network Settings' );
    2323$parent_file = 'settings.php';
  • wp-admin/network/site-info.php

     
    4040
    4141$details = get_blog_details( $id );
    4242if ( !can_edit_network( $details->site_id ) )
    43         wp_die( __( 'You do not have permission to access this page.' ) );
     43        wp_die( __( 'You do not have permission to access this page.' ), '', array('response' => 403) );
    4444
    4545$parsed = parse_url( $details->siteurl );
    4646$is_main_site = is_main_site( $id );
  • wp-admin/network/site-settings.php

     
    4040
    4141$details = get_blog_details( $id );
    4242if ( !can_edit_network( $details->site_id ) )
    43         wp_die( __( 'You do not have permission to access this page.' ) );
     43        wp_die( __( 'You do not have permission to access this page.' ), '', array('response' => 403) );
    4444
    4545$is_main_site = is_main_site( $id );
    4646
  • wp-admin/network/site-themes.php

     
    5757
    5858$details = get_blog_details( $id );
    5959if ( !can_edit_network( $details->site_id ) )
    60         wp_die( __( 'You do not have permission to access this page.' ) );
     60        wp_die( __( 'You do not have permission to access this page.' ), '', array('response' => 403) );
    6161
    6262$is_main_site = is_main_site( $id );
    6363
  • wp-admin/network/site-users.php

     
    5050
    5151$details = get_blog_details( $id );
    5252if ( ! can_edit_network( $details->site_id ) )
    53         wp_die( __( 'You do not have permission to access this page.' ) );
     53        wp_die( __( 'You do not have permission to access this page.' ), '', array('response' => 403) );
    5454
    5555$is_main_site = is_main_site( $id );
    5656
  • wp-admin/network/sites.php

     
    1414        wp_die( __( 'Multisite support is not enabled.' ) );
    1515
    1616if ( ! current_user_can( 'manage_sites' ) )
    17         wp_die( __( 'You do not have permission to access this page.' ) );
     17        wp_die( __( 'You do not have permission to access this page.' ), '', array('response' => 403) );
    1818
    1919$wp_list_table = _get_list_table( 'WP_MS_Sites_List_Table' );
    2020$pagenum = $wp_list_table->get_pagenum();
     
    9797
    9898                case 'deleteblog':
    9999                        if ( ! current_user_can( 'delete_sites' ) )
    100                                 wp_die( __( 'You do not have permission to access this page.' ) );
     100                                wp_die( __( 'You do not have permission to access this page.' ), '', array('response' => 403) );
    101101
    102102                        $updated_action = 'not_deleted';
    103103                        if ( $id != '0' && $id != $current_site->blog_id && current_user_can( 'delete_site', $id ) ) {
  • wp-admin/network/upgrade.php

     
    3636require_once( ABSPATH . 'wp-admin/admin-header.php' );
    3737
    3838if ( ! current_user_can( 'manage_network' ) )
    39         wp_die( __( 'You do not have permission to access this page.' ) );
     39        wp_die( __( 'You do not have permission to access this page.' ), '', array('response' => 403) );
    4040
    4141echo '<div class="wrap">';
    4242echo '<h2>' . __( 'Upgrade Network' ) . '</h2>';
  • wp-admin/network/user-new.php

     
    3333if ( isset($_REQUEST['action']) && 'add-user' == $_REQUEST['action'] ) {
    3434        check_admin_referer( 'add-user', '_wpnonce_add-user' );
    3535        if ( ! current_user_can( 'manage_network_users' ) )
    36                 wp_die( __( 'You do not have permission to access this page.' ) );
     36                wp_die( __( 'You do not have permission to access this page.' ), '', array('response' => 403) );
    3737
    3838        if ( ! is_array( $_POST['user'] ) )
    3939                wp_die( __( 'Cannot create an empty user.' ) );
  • wp-admin/network/users.php

     
    1414        wp_die( __( 'Multisite support is not enabled.' ) );
    1515
    1616if ( ! current_user_can( 'manage_network_users' ) )
    17         wp_die( __( 'You do not have permission to access this page.' ) );
     17        wp_die( __( 'You do not have permission to access this page.' ), '', array('response' => 403) );
    1818
    1919function confirm_delete_users( $users ) {
    2020        $current_user = wp_get_current_user();
     
    9595        switch ( $_GET['action'] ) {
    9696                case 'deleteuser':
    9797                        if ( ! current_user_can( 'manage_network_users' ) )
    98                                 wp_die( __( 'You do not have permission to access this page.' ) );
     98                                wp_die( __( 'You do not have permission to access this page.' ), '', array('response' => 403) );
    9999
    100100                        check_admin_referer( 'deleteuser' );
    101101
     
    116116
    117117                case 'allusers':
    118118                        if ( !current_user_can( 'manage_network_users' ) )
    119                                 wp_die( __( 'You do not have permission to access this page.' ) );
     119                                wp_die( __( 'You do not have permission to access this page.' ), '', array('response' => 403) );
    120120
    121121                        if ( ( isset( $_POST['action']) || isset($_POST['action2'] ) ) && isset( $_POST['allusers'] ) ) {
    122122                                check_admin_referer( 'bulk-users-network' );
     
    129129                                                switch ( $doaction ) {
    130130                                                        case 'delete':
    131131                                                                if ( ! current_user_can( 'delete_users' ) )
    132                                                                         wp_die( __( 'You do not have permission to access this page.' ) );
     132                                                                        wp_die( __( 'You do not have permission to access this page.' ), '', array('response' => 403) );
    133133                                                                $title = __( 'Users' );
    134134                                                                $parent_file = 'users.php';
    135135                                                                require_once( ABSPATH . 'wp-admin/admin-header.php' );
     
    178178                case 'dodelete':
    179179                        check_admin_referer( 'ms-users-delete' );
    180180                        if ( ! ( current_user_can( 'manage_network_users' ) && current_user_can( 'delete_users' ) ) )
    181                                 wp_die( __( 'You do not have permission to access this page.' ) );
     181                                wp_die( __( 'You do not have permission to access this page.' ), '', array('response' => 403) );
    182182
    183183                        if ( ! empty( $_POST['blog'] ) && is_array( $_POST['blog'] ) ) {
    184184                                foreach ( $_POST['blog'] as $id => $users ) {