Trim when updating options.

git-svn-id: https://develop.svn.wordpress.org/trunk@1129 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2004-04-22 21:29:59 +00:00
parent 4d02ea2817
commit 724b7a7cc8
1 changed files with 3 additions and 1 deletions

View File

@ -331,7 +331,9 @@ function get_alloptions() {
function update_option($option_name, $newvalue) {
global $wpdb, $tableoptions, $cache_settings;
// No validation at the moment
$newvalue = stripslashes($newvalue);
$newvalue = trim($newvalue); // I can't think of any situation we wouldn't want to trim
$newvalue = $wpdb->escape($newvalue);
$wpdb->query("UPDATE $tableoptions SET option_value = '$newvalue' WHERE option_name = '$option_name'");
$cache_settings = get_alloptions(); // Re cache settings
return true;