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
This commit is contained in:
parent
7623634aaf
commit
1fdc779439
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user