From 1fdc779439abfe0597b16d385541af6d8dbb38dd Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sun, 17 Jul 2005 18:41:11 +0000 Subject: [PATCH] Trim option value only if it is a string. Don't trim objects and arrays. Props: Jason Bainbridge git-svn-id: https://develop.svn.wordpress.org/trunk@2717 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 8c095f2acb..640e530941 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -328,8 +328,9 @@ function get_alloptions() { function update_option($option_name, $newvalue) { global $wpdb, $cache_settings; - $newvalue = trim($newvalue); // I can't think of any situation we wouldn't want to trim - + if ( is_string($newvalue) ) + $newvalue = trim($newvalue); + // If the new and old values are the same, no need to update. if ( $newvalue == get_option($option_name) ) return true;