From 752e02538a803e4ac3df8339ae49449b1fdfce80 Mon Sep 17 00:00:00 2001 From: Andrew 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: https://develop.svn.wordpress.org/trunk@13789 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 d4557883e0..126f1abbff 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' ] ) );