Make WordPress Core

Ticket #26402: 26402.2.diff

File 26402.2.diff, 946 bytes (added by lukecavanagh, 8 years ago)

Patch refresh

  • src/wp-includes/option.php

     
    12641264                $serialized_value = maybe_serialize( $value );
    12651265                $result = $wpdb->insert( $wpdb->sitemeta, array( 'site_id'    => $network_id, 'meta_key'   => $option, 'meta_value' => $serialized_value ) );
    12661266
    1267                 if ( ! $result ) {
     1267                if ( ! $result )
     1268                                if ( ! defined( 'WP_INSTALLING' ) ) {
     1269                                                $alloptions = wp_load_alloptions();
     1270                                                if ( isset( $alloptions[$option] ) ) {
     1271                                                                unset($alloptions[$option]);
     1272                                                                wp_cache_set( 'alloptions', $alloptions, 'options' );
     1273                                                }
     1274                                } else if ( !isset( $alloptions[$option] ) ) {
     1275                                                wp_cache_delete( 'alloptions', 'options' );
     1276                                } else {
     1277                                                wp_cache_delete( $option, 'options' );
     1278                                }
     1279                                add_option( $option, $newvalue );
     1280
    12681281                        return false;
    12691282                }