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:
parent
9bd6651300
commit
7cdda656cc
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue