Make WordPress Core

Ticket #27935: option.php.patch

File option.php.patch, 668 bytes (added by doublesharp, 11 years ago)

cache empty meta_values in notoptions

  • wp-includes/option.php

     
    967967                        $row = $wpdb->get_row( $wpdb->prepare("SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = %s AND site_id = %d", $option, $wpdb->siteid ) );
    968968
    969969                        // Has to be get_row instead of get_var because of funkiness with 0, false, null values
    970                         if ( is_object( $row ) ) {
     970                        if ( is_object( $row ) && $row->meta_value !== '' ) {
    971971                                $value = $row->meta_value;
    972972                                $value = maybe_unserialize( $value );
    973973                                wp_cache_set( $cache_key, $value, 'site-options' );