Move unregistered check to proper branch of code. prevents options.php panel from throwing errors. see #11730
git-svn-id: https://develop.svn.wordpress.org/trunk@13789 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3ca4e60665
commit
752e02538a
@ -92,19 +92,22 @@ if ( is_multisite() && is_super_admin() ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* If $_GET['action'] == 'update' we are saving settings sent from a settings page
|
* If $_GET['action'] == 'update' we are saving settings sent from a settings page
|
||||||
*/
|
*/
|
||||||
if ( 'update' == $action ) {
|
if ( 'update' == $action ) {
|
||||||
if ( 'options' == $option_page && !isset($_POST['option_page']) ) // This is for back compat and will eventually be removed.
|
if ( 'options' == $option_page && !isset( $_POST['option_page'] ) ) { // This is for back compat and will eventually be removed.
|
||||||
|
$unregistered = true;
|
||||||
check_admin_referer( 'update-options' );
|
check_admin_referer( 'update-options' );
|
||||||
else
|
} else {
|
||||||
|
$unregistered = false;
|
||||||
check_admin_referer( $option_page . '-options' );
|
check_admin_referer( $option_page . '-options' );
|
||||||
|
}
|
||||||
|
|
||||||
if ( !isset( $whitelist_options[ $option_page ] ) )
|
if ( !isset( $whitelist_options[ $option_page ] ) )
|
||||||
wp_die( __( 'Error: options page not found.' ) );
|
wp_die( __( 'Error: options page not found.' ) );
|
||||||
|
|
||||||
if ( $unregistered = ( 'options' == $option_page ) ) {
|
if ( 'options' == $option_page ) {
|
||||||
if ( is_multisite() && ! is_super_admin() )
|
if ( is_multisite() && ! is_super_admin() )
|
||||||
wp_die( __( 'You do not have sufficient permissions to modify unregistered settings for this site.' ) );
|
wp_die( __( 'You do not have sufficient permissions to modify unregistered settings for this site.' ) );
|
||||||
$options = explode( ',', stripslashes( $_POST[ 'page_options' ] ) );
|
$options = explode( ',', stripslashes( $_POST[ 'page_options' ] ) );
|
||||||
|
Loading…
Reference in New Issue
Block a user