Fix option sanitization slashing. fixes #4949 for 2.2

git-svn-id: http://svn.automattic.com/wordpress/branches/2.2@6083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-09-11 20:24:42 +00:00
parent 9bd6651300
commit 7cdda656cc
2 changed files with 4 additions and 2 deletions

View File

@ -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);
}
}

View File

@ -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);