From 0174984f7f19b6cd91b9bbac0af9d1edcaa31429 Mon Sep 17 00:00:00 2001 From: saxmatt Date: Thu, 26 Feb 2004 14:37:15 +0000 Subject: [PATCH] Option fixes. git-svn-id: http://svn.automattic.com/wordpress/trunk@939 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/options-general.php | 3 ++- wp-admin/options-writing.php | 7 ++++--- wp-admin/options.php | 17 +++++++++++------ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/wp-admin/options-general.php b/wp-admin/options-general.php index 428dc3049e8..c9e1a0c0cb0 100644 --- a/wp-admin/options-general.php +++ b/wp-admin/options-general.php @@ -66,6 +66,7 @@ function add_magic_quotes($array) {

General Options

+ @@ -106,7 +107,7 @@ function add_magic_quotes($array) { - + diff --git a/wp-admin/options-writing.php b/wp-admin/options-writing.php index d36bcbec360..85730faa8db 100644 --- a/wp-admin/options-writing.php +++ b/wp-admin/options-writing.php @@ -65,11 +65,12 @@ function add_magic_quotes($array) {

Writing Options

- +
Weblog title:
Times in the weblog should differ by: Times in the weblog should differ by: hours
- - + + diff --git a/wp-admin/options.php b/wp-admin/options.php index 66f3cf90a93..a3436b7ac03 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -44,7 +44,7 @@ function add_magic_quotes($array) { switch($action) { -case "update": +case 'update': $standalone = 1; include_once("./admin-header.php"); $any_changed = 0; @@ -53,19 +53,24 @@ function add_magic_quotes($array) { // pull the vars from the post // validate ranges etc. // update the values - foreach ($_POST as $key => $value) { - $option_names[] = "'$key'"; + if (!$_POST['page_options']) { + foreach ($_POST as $key => $value) { + $option_names[] = "'$key'"; + } + $option_names = implode(',', $option_names); + } else { + $option_names = stripslashes($_POST['page_options']); } - $option_names = implode(',', $option_names); $options = $wpdb->get_results("SELECT $tableoptions.option_id, option_name, option_type, option_value, option_admin_level FROM $tableoptions WHERE option_name IN ($option_names)"); +// die(var_dump($options)); if ($options) { foreach ($options as $option) { // should we even bother checking? if ($user_level >= $option->option_admin_level) { - $this_name = $option->option_name; $old_val = stripslashes($option->option_value); - $new_val = $_POST[$this_name]; + $new_val = $_POST[$option->option_name]; + if (!$new_val) $new_val = 0; if ($new_val != $old_val) { // get type and validate
Size of the writing box, in lines: Size of the writing box: + lines
Character Setting: