Changeset 3234
- Timestamp:
- 11/29/2005 07:58:50 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r3229 r3234 258 258 259 259 260 function maybe_unserialize($original) { 261 if ( $gm = @ unserialize($original) ) 262 return $gm; 263 else 264 return $original; 265 } 266 260 267 /* Options functions */ 261 268 … … 287 294 $value = preg_replace('|/+$|', '', $value); 288 295 289 @ $kellogs = unserialize($value); 290 if ( $kellogs !== FALSE ) 291 return apply_filters('option_' . $setting, $kellogs); 292 else 293 return apply_filters('option_' . $setting, $value); 296 return apply_filters( 'option_' . $setting, maybe_unserialize($value) ); 294 297 } 295 298 … … 329 332 if ( 'category_base' == $option->option_name ) 330 333 $option->option_value = preg_replace('|/+$|', '', $option->option_value); 331 @ $value = unserialize($option->option_value); 332 if ( $value === FALSE ) 333 $value = $option->option_value; 334 $value = maybe_unserialize($option->option_value); 334 335 $all_options->{$option->option_name} = apply_filters('pre_option_' . $option->option_name, $value); 335 336 } … … 460 461 if ( isset($post_meta_cache[$post_id][$key]) ) { 461 462 if ( $single ) { 462 return $post_meta_cache[$post_id][$key][0];463 return maybe_unserialize( $post_meta_cache[$post_id][$key][0] ); 463 464 } else { 464 return $post_meta_cache[$post_id][$key];465 return maybe_unserialize( $post_meta_cache[$post_id][$key][0] ); 465 466 } 466 467 } … … 477 478 if ( $single ) { 478 479 if ( count($values) ) { 479 $return = $values[0];480 $return = maybe_unserialize( $values[0] ); 480 481 } else { 481 482 return ''; … … 485 486 } 486 487 487 @ $kellogs = unserialize($return); 488 if ( $kellogs !== FALSE ) 489 return $kellogs; 490 else return $return; 488 return maybe_unserialize($return); 491 489 } 492 490
Note: See TracChangeset
for help on using the changeset viewer.