Trim option value only if it is a string. Don't trim objects and arrays. Props: Jason Bainbridge

git-svn-id: http://svn.automattic.com/wordpress/trunk@2717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-07-17 18:41:11 +00:00
parent 0282a8fc0c
commit 5177196b10
1 changed files with 3 additions and 2 deletions

View File

@ -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;