mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 19:46:21 +00:00
Switch to a 403 response code in places where it is more appropriate than a 500 due to permissions errors.
props tomdxw. fixes #30927. Built from https://develop.svn.wordpress.org/trunk@31300 git-svn-id: http://core.svn.wordpress.org/trunk@31281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
cf68b77790
commit
5ac0568ee3
@ -316,7 +316,7 @@ if ( !user_can_access_admin_page() ) {
|
|||||||
*/
|
*/
|
||||||
do_action( 'admin_page_access_denied' );
|
do_action( 'admin_page_access_denied' );
|
||||||
|
|
||||||
wp_die( __('You do not have sufficient permissions to access this page.') );
|
wp_die( __( 'You do not have sufficient permissions to access this page.' ), 403 );
|
||||||
}
|
}
|
||||||
|
|
||||||
$menu = add_menu_classes($menu);
|
$menu = add_menu_classes($menu);
|
||||||
|
@ -625,7 +625,7 @@ function _access_denied_splash() {
|
|||||||
$blog_name = get_bloginfo( 'name' );
|
$blog_name = get_bloginfo( 'name' );
|
||||||
|
|
||||||
if ( empty( $blogs ) )
|
if ( empty( $blogs ) )
|
||||||
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 ) );
|
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 );
|
||||||
|
|
||||||
$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>';
|
$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>';
|
||||||
$output .= '<p>' . __( 'If you reached this screen by accident and meant to visit one of your own sites, here are some shortcuts to help you find your way.' ) . '</p>';
|
$output .= '<p>' . __( 'If you reached this screen by accident and meant to visit one of your own sites, here are some shortcuts to help you find your way.' ) . '</p>';
|
||||||
@ -643,7 +643,7 @@ function _access_denied_splash() {
|
|||||||
|
|
||||||
$output .= '</table>';
|
$output .= '</table>';
|
||||||
|
|
||||||
wp_die( $output );
|
wp_die( $output, 403 );
|
||||||
}
|
}
|
||||||
add_action( 'admin_page_access_denied', '_access_denied_splash', 99 );
|
add_action( 'admin_page_access_denied', '_access_denied_splash', 99 );
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.2-alpha-31299';
|
$wp_version = '4.2-alpha-31300';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user