Make WordPress Core


Ignore:
Timestamp:
11/16/2014 06:15:29 AM (10 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/edit-tags.php

    r29821 r30356  
    1919
    2020if ( ! current_user_can( $tax->cap->manage_terms ) )
    21     wp_die( __( 'Cheatin’ uh?' ) );
     21    wp_die( __( 'Cheatin’ uh?' ), 403 );
    2222
    2323$wp_list_table = _get_list_table('WP_Terms_List_Table');
     
    4848
    4949    if ( !current_user_can( $tax->cap->edit_terms ) )
    50         wp_die( __( 'Cheatin’ uh?' ) );
     50        wp_die( __( 'Cheatin’ uh?' ), 403 );
    5151
    5252    $ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );
     
    8484
    8585    if ( !current_user_can( $tax->cap->delete_terms ) )
    86         wp_die( __( 'Cheatin’ uh?' ) );
     86        wp_die( __( 'Cheatin’ uh?' ), 403 );
    8787
    8888    wp_delete_term( $tag_ID, $taxonomy );
     
    9696
    9797    if ( !current_user_can( $tax->cap->delete_terms ) )
    98         wp_die( __( 'Cheatin’ uh?' ) );
     98        wp_die( __( 'Cheatin’ uh?' ), 403 );
    9999
    100100    $tags = (array) $_REQUEST['delete_tags'];
     
    134134
    135135    if ( !current_user_can( $tax->cap->edit_terms ) )
    136         wp_die( __( 'Cheatin’ uh?' ) );
     136        wp_die( __( 'Cheatin’ uh?' ), 403 );
    137137
    138138    $tag = get_term( $tag_ID, $taxonomy );
Note: See TracChangeset for help on using the changeset viewer.