From 384cbb5b1091fe74753653d1124a3f4707bf108e Mon Sep 17 00:00:00 2001
From: Tom Adams <tom@dxw.com>
Date: Mon, 5 Jan 2015 16:57:00 -0500
Subject: [PATCH] Return 403 responses
---
wp-admin/includes/menu.php | 2 +-
wp-admin/includes/ms.php | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/wp-admin/includes/menu.php b/wp-admin/includes/menu.php
index 873f737..41de27c 100644
|
a
|
b
|
if ( !user_can_access_admin_page() ) { |
| 316 | 316 | */ |
| 317 | 317 | do_action( 'admin_page_access_denied' ); |
| 318 | 318 | |
| 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 ); |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | $menu = add_menu_classes($menu); |
diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php
index a9c62bb..c466bc3 100644
|
a
|
b
|
function _access_denied_splash() { |
| 624 | 624 | $blog_name = get_bloginfo( 'name' ); |
| 625 | 625 | |
| 626 | 626 | if ( empty( $blogs ) ) |
| 627 | | 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 ) ); |
| | 627 | 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 ); |
| 628 | 628 | |
| 629 | 629 | $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>'; |
| 630 | 630 | $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>'; |
| … |
… |
function _access_denied_splash() { |
| 642 | 642 | |
| 643 | 643 | $output .= '</table>'; |
| 644 | 644 | |
| 645 | | wp_die( $output ); |
| | 645 | wp_die( $output, 403 ); |
| 646 | 646 | } |
| 647 | 647 | add_action( 'admin_page_access_denied', '_access_denied_splash', 99 ); |
| 648 | 648 | |