Move unregistered check to proper branch of code. prevents options.php panel from throwing errors. see #11730

git-svn-id: http://svn.automattic.com/wordpress/trunk@13789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-03-21 07:38:10 +00:00
parent 3d5e274179
commit 73f9683d51
1 changed files with 7 additions and 4 deletions

View File

@ -92,19 +92,22 @@ if ( is_multisite() && is_super_admin() ) {
}
}
/**
/*
* If $_GET['action'] == 'update' we are saving settings sent from a settings page
*/
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' );
else
} else {
$unregistered = false;
check_admin_referer( $option_page . '-options' );
}
if ( !isset( $whitelist_options[ $option_page ] ) )
wp_die( __( 'Error: options page not found.' ) );
if ( $unregistered = ( 'options' == $option_page ) ) {
if ( 'options' == $option_page ) {
if ( is_multisite() && ! is_super_admin() )
wp_die( __( 'You do not have sufficient permissions to modify unregistered settings for this site.' ) );
$options = explode( ',', stripslashes( $_POST[ 'page_options' ] ) );