Make WordPress Core


Ignore:
Timestamp:
11/16/2014 06:15:29 AM (7 years ago)
Author:
johnbillion
Message:

Switch to a 403 response code in places where it is more appropriate than a 500 due to permissions errors.

Fixes #10551
Props nacin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/user-new.php

    r30033 r30356  
    1212if ( is_multisite() ) {
    1313    if ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) )
    14         wp_die( __( 'Cheatin’ uh?' ) );
     14        wp_die( __( 'Cheatin’ uh?' ), 403 );
    1515} elseif ( ! current_user_can( 'create_users' ) ) {
    16     wp_die( __( 'Cheatin’ uh?' ) );
     16    wp_die( __( 'Cheatin’ uh?' ), 403 );
    1717}
    1818
     
    5656
    5757    if ( ! current_user_can('promote_user', $user_details->ID) )
    58         wp_die(__('Cheatin’ uh?'));
     58        wp_die( __( 'Cheatin’ uh?' ), 403 );
    5959
    6060    // Adding an existing user to this blog
     
    9393
    9494    if ( ! current_user_can('create_users') )
    95         wp_die(__('Cheatin’ uh?'));
     95        wp_die( __( 'Cheatin’ uh?' ), 403 );
    9696
    9797    if ( ! is_multisite() ) {
Note: See TracChangeset for help on using the changeset viewer.