From 73f9683d5157301e68adaf8434ac6e600dfe5127 Mon Sep 17 00:00:00 2001 From: nacin Date: Sun, 21 Mar 2010 07:38:10 +0000 Subject: [PATCH] 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 --- wp-admin/options.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/wp-admin/options.php b/wp-admin/options.php index d4557883e..126f1abbf 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -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' ] ) );