diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php
index 8f0b6d5116..a2f8f9748f 100644
--- a/wp-admin/admin-functions.php
+++ b/wp-admin/admin-functions.php
@@ -1,5 +1,13 @@
$v) {
+ if (is_array($v)) {
+ $array[$k] = add_magic_quotes($v);
+ } else {
+ $array[$k] = addslashes($v);
+ }
+ }
+ return $array;
+}
+
+if (!get_magic_quotes_gpc()) {
+ $HTTP_GET_VARS = add_magic_quotes($HTTP_GET_VARS);
+ $HTTP_POST_VARS = add_magic_quotes($HTTP_POST_VARS);
+ $HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS);
+}
+
+$wpvarstoreset = array('action','standalone', 'option_group_id');
+for ($i=0; $iAsk for a promotion to your blog admin :)");
+}
+?>
+
+
+
+
diff --git a/wp-admin/options.php b/wp-admin/options.php
index 83639ec76b..fd30c70c74 100644
--- a/wp-admin/options.php
+++ b/wp-admin/options.php
@@ -53,18 +53,19 @@ case "update":
// pull the vars from the post
// validate ranges etc.
// update the values
- $options = $wpdb->get_results("SELECT $tableoptions.option_id, option_name, option_type, option_value, option_admin_level "
- . "FROM $tableoptions "
- . "LEFT JOIN $tableoptiongroup_options ON $tableoptions.option_id = $tableoptiongroup_options.option_id "
- . "WHERE group_id = $option_group_id "
- . "ORDER BY seq");
+ foreach ($_POST as $key => $value) {
+ $option_names[] = "'$key'";
+ }
+ $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)");
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 = $HTTP_POST_VARS[$this_name];
+ $new_val = $_POST[$this_name];
if ($new_val != $old_val) {
// get type and validate
@@ -97,8 +98,8 @@ case "update":
}
$message .= $dB_errors . '
' . $validation_message;
}
-
- //break; //fall through
+ header('Location: ' . $_SERVER['HTTP_REFERER']);
+ break;
default:
$standalone = 0;
@@ -135,6 +136,7 @@ if ($non_was_selected) { // no group pre-selected, display opening page
?>