From 724b7a7cc88b4d5c2c6c211a54c14dab7d0ee70f Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Thu, 22 Apr 2004 21:29:59 +0000 Subject: [PATCH] Trim when updating options. git-svn-id: https://develop.svn.wordpress.org/trunk@1129 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 2475a1d911..ebf47d4098 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -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;