Make WordPress Core

Changeset 13433


Ignore:
Timestamp:
02/26/2010 06:51:37 PM (15 years ago)
Author:
nacin
Message:

Consistently pass unserialized values to hooks in update_site_option(). Change add_option() and add_site_option() to do the same. Any plugin using maybe_unserialize() would continue to work as the value would no longer need to be unserialized. fixes #10788

File:
1 edited

Legend:

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

    r13427 r13433  
    577577            return;
    578578
     579    $_value = $value;
    579580    $value = maybe_serialize( $value );
    580581    $autoload = ( 'no' === $autoload ) ? 'no' : 'yes';
     
    600601
    601602    if ( $result ) {
    602         do_action( "add_option_{$option}", $option, $value );
    603         do_action( 'added_option', $option, $value );
     603        do_action( "add_option_{$option}", $option, $_value );
     604        do_action( 'added_option', $option, $_value );
    604605        return true;
    605606    }
     
    34453446        wp_cache_set( $cache_key, $value, 'site-options' );
    34463447
     3448        $_value = $value;
    34473449        $value = maybe_serialize($value);
    34483450
     
    34503452    }
    34513453
    3452     do_action( "add_site_option_{$option}", $option, $value );
    3453     do_action( "add_site_option", $option, $value );
     3454    do_action( "add_site_option_{$option}", $option, $_value );
     3455    do_action( "add_site_option", $option, $_value );
    34543456
    34553457    return $result;
     
    35333535        wp_cache_set( $cache_key, $value, 'site-options' );
    35343536
     3537        $_value = $value;
    35353538        $value = maybe_serialize( $value );
    35363539        $result = $wpdb->update( $wpdb->sitemeta, array( 'meta_value' => $value ), array( 'site_id' => $wpdb->siteid, 'meta_key' => $option ) );
     3540        $value = $_value;
    35373541    }
    35383542
Note: See TracChangeset for help on using the changeset viewer.