Make WordPress Core


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

    r29961 r30356  
    1111
    1212if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') )
    13     wp_die( __( 'Cheatin’ uh?' ) );
     13    wp_die( __( 'Cheatin’ uh?' ), 403 );
    1414
    1515if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) {
     
    1818        $theme = wp_get_theme( $_GET['stylesheet'] );
    1919        if ( ! $theme->exists() || ! $theme->is_allowed() )
    20             wp_die( __( 'Cheatin’ uh?' ) );
     20            wp_die( __( 'Cheatin’ uh?' ), 403 );
    2121        switch_theme( $theme->get_stylesheet() );
    2222        wp_redirect( admin_url('themes.php?activated=true') );
     
    2626        $theme = wp_get_theme( $_GET['stylesheet'] );
    2727        if ( !current_user_can('delete_themes') || ! $theme->exists() )
    28             wp_die( __( 'Cheatin’ uh?' ) );
     28            wp_die( __( 'Cheatin’ uh?' ), 403 );
    2929        delete_theme($_GET['stylesheet']);
    3030        wp_redirect( admin_url('themes.php?deleted=true') );
Note: See TracChangeset for help on using the changeset viewer.