Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/wp-admin/options-discussion.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
require_once __DIR__ . '/admin.php';

if ( ! current_user_can( 'manage_options' ) ) {
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ), 403 );
}

// Used in the HTML title tag.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/options-general.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
require_once ABSPATH . 'wp-admin/includes/translation-install.php';

if ( ! current_user_can( 'manage_options' ) ) {
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ), 403 );
}

// Used in the HTML title tag.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/options-media.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
require_once __DIR__ . '/admin.php';

if ( ! current_user_can( 'manage_options' ) ) {
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ), 403 );
}

// Used in the HTML title tag.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/options-permalink.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
require_once __DIR__ . '/admin.php';

if ( ! current_user_can( 'manage_options' ) ) {
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ), 403 );
}

// Used in the HTML title tag.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/options-privacy.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
require_once __DIR__ . '/admin.php';

if ( ! current_user_can( 'manage_privacy_options' ) ) {
wp_die( __( 'Sorry, you are not allowed to manage privacy options on this site.' ) );
wp_die( __( 'Sorry, you are not allowed to manage privacy options on this site.' ), 403 );
}

if ( isset( $_GET['tab'] ) && 'policyguide' === $_GET['tab'] ) {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/options-reading.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
require_once __DIR__ . '/admin.php';

if ( ! current_user_can( 'manage_options' ) ) {
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ), 403 );
}

// Used in the HTML title tag.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/options-writing.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
require_once __DIR__ . '/admin.php';

if ( ! current_user_can( 'manage_options' ) ) {
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ), 403 );
}

// Used in the HTML title tag.
Expand Down
5 changes: 3 additions & 2 deletions src/wp-admin/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,14 @@
/* translators: %s: The options page name. */
__( '<strong>Error:</strong> The %s options page is not in the allowed options list.' ),
'<code>' . esc_html( $option_page ) . '</code>'
)
),
403
);
}

if ( 'options' === $option_page ) {
if ( is_multisite() && ! current_user_can( 'manage_network_options' ) ) {
wp_die( __( 'Sorry, you are not allowed to modify unregistered settings for this site.' ) );
wp_die( __( 'Sorry, you are not allowed to modify unregistered settings for this site.' ), 403 );
}
$options = isset( $_POST['page_options'] ) ? explode( ',', wp_unslash( $_POST['page_options'] ) ) : null;
} else {
Expand Down
3 changes: 2 additions & 1 deletion src/wp-includes/option.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,8 @@ function wp_protect_special_option( $option ) {
/* translators: %s: Option name. */
__( '%s is a protected WP option and may not be modified' ),
esc_html( $option )
)
),
400
);
}
}
Expand Down
Loading