From dcb278f00640f86b9ad3e1d00f363fb08953b65e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 29 Jan 2015 21:14:54 +0000 Subject: [PATCH] Switch to a 403 response code in places where it is more appropriate than a 500 due to permissions errors. props tomdxw. fixes #30927. git-svn-id: https://develop.svn.wordpress.org/trunk@31300 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/menu.php | 2 +- src/wp-admin/includes/ms.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/menu.php b/src/wp-admin/includes/menu.php index 873f7379d9..cb6111a7d8 100644 --- a/src/wp-admin/includes/menu.php +++ b/src/wp-admin/includes/menu.php @@ -316,7 +316,7 @@ if ( !user_can_access_admin_page() ) { */ 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); diff --git a/src/wp-admin/includes/ms.php b/src/wp-admin/includes/ms.php index 453b751aad..c58189e371 100644 --- a/src/wp-admin/includes/ms.php +++ b/src/wp-admin/includes/ms.php @@ -625,7 +625,7 @@ function _access_denied_splash() { $blog_name = get_bloginfo( 'name' ); 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 = '

' . 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 ) . '

'; $output .= '

' . __( '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.' ) . '

'; @@ -643,7 +643,7 @@ function _access_denied_splash() { $output .= ''; - wp_die( $output ); + wp_die( $output, 403 ); } add_action( 'admin_page_access_denied', '_access_denied_splash', 99 );