Trim when updating options.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6f66293c21
commit
4677ac0c77
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue