diff --git a/wp-admin/options.php b/wp-admin/options.php index 480b6da64e..df644dcfde 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -29,8 +29,9 @@ case 'update': if ($options) { foreach ($options as $option) { $option = trim($option); - $value = trim($_POST[$option]); - $value = sanitize_option($option, $value); // This does stripslashes on those that need it + $value = $_POST[$option]; + if(!is_array($value)) $value = trim($value); + $value = stripslashes_deep($value); update_option($option, $value); } } diff --git a/wp-includes/functions.php b/wp-includes/functions.php index a5f7db52c1..5e87b1f1a1 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -310,6 +310,7 @@ function update_option($option_name, $newvalue) { wp_protect_special_option($option_name); $safe_option_name = $wpdb->escape($option_name); + $newvalue = sanitize_option($option_name, $newvalue); if ( is_string($newvalue) ) $newvalue = trim($newvalue);