WordPress.org

Make WordPress Core

Changeset 14777


Ignore:
Timestamp:
05/21/10 14:15:59 (4 years ago)
Author:
dd32
Message:

Clone Objects in add_option()/update_option() to prevent storing PHP5 object references in memory cache. See [9740]. Fixes #13480

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r14680 r14777  
    487487    wp_protect_special_option( $option ); 
    488488 
     489    if ( is_object($newvalue) ) 
     490        $newvalue = wp_clone($newvalue); 
     491 
    489492    $newvalue = sanitize_option( $option, $newvalue ); 
    490493    $oldvalue = get_option( $option ); 
     
    566569 
    567570    wp_protect_special_option( $option ); 
     571 
     572    if ( is_object($value) ) 
     573        $value = wp_clone($value); 
     574 
    568575    $value = sanitize_option( $option, $value ); 
    569576 
Note: See TracChangeset for help on using the changeset viewer.