Make WordPress Core


Ignore:
Timestamp:
03/07/2015 05:59:17 AM (11 years ago)
Author:
jeremyfelt
Message:

Return HTTP status code 403 in network admin when access is forbidden.

When the error message "You do not have permission to access this page" is used in network admin screens, return an HTTP status code of 403 to match. Previously: [30356] and [31300].

Props yo-l1982.

Fixes #31422.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/sites.php

    r31200 r31658  
    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' );
     
    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';
Note: See TracChangeset for help on using the changeset viewer.