Ticket #2591: serialize_all_options-TAKE_2.diff
File serialize_all_options-TAKE_2.diff, 1.0 KB (added by , 19 years ago) |
---|
-
wp-includes/functions.php
365 365 return true; 366 366 } 367 367 368 if ( is_array($newvalue) || is_object($newvalue))368 if ( strpos($_SERVER['REQUEST_URI'], '/wp-admin/options.php') === false ) 369 369 $newvalue = serialize($newvalue); 370 370 371 371 wp_cache_set($option_name, $newvalue, 'options'); … … 395 395 if ( false !== get_option($name) ) 396 396 return; 397 397 398 if ( is_array($value) || is_object($value))398 if ( strpos($_SERVER['REQUEST_URI'], '/wp-admin/options.php') === false ) 399 399 $value = serialize($value); 400 400 401 401 wp_cache_set($name, $value, 'options'); … … 2164 2164 if ( !is_numeric( $user_id ) ) 2165 2165 return false; 2166 2166 $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key); 2167 2168 if ( is_array($meta_value) || is_object($meta_value) ) 2169 $meta_value = serialize($meta_value); 2167 $meta_value = serialize($meta_value); 2170 2168 $meta_value = trim( $meta_value ); 2171 2169 2172 2170 if (empty($meta_value)) {