Make WordPress Core

Changeset 31300


Ignore:
Timestamp:
01/29/2015 09:14:54 PM (10 years ago)
Author:
SergeyBiryukov
Message:

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

props tomdxw.
fixes #30927.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/menu.php

    r29206 r31300  
    317317    do_action( 'admin_page_access_denied' );
    318318
    319     wp_die( __('You do not have sufficient permissions to access this page.') );
     319    wp_die( __( 'You do not have sufficient permissions to access this page.' ), 403 );
    320320}
    321321
  • trunk/src/wp-admin/includes/ms.php

    r31113 r31300  
    626626
    627627    if ( empty( $blogs ) )
    628         wp_die( sprintf( __( 'You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.' ), $blog_name ) );
     628        wp_die( sprintf( __( 'You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.' ), $blog_name ), 403 );
    629629
    630630    $output = '<p>' . sprintf( __( 'You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.' ), $blog_name ) . '</p>';
     
    644644    $output .= '</table>';
    645645
    646     wp_die( $output );
     646    wp_die( $output, 403 );
    647647}
    648648add_action( 'admin_page_access_denied', '_access_denied_splash', 99 );
Note: See TracChangeset for help on using the changeset viewer.