WordPress.org

Make WordPress Core

Ticket #13043: functions.php.diff

File functions.php.diff, 886 bytes (added by laceous, 8 years ago)

change get_var to get_row

  • wp-includes/functions.php

     
    34613461                        $value = wp_cache_get($cache_key, 'site-options');
    34623462
    34633463                if ( !isset($value) || (false === $value) ) {
    3464                         $value = $wpdb->get_var( $wpdb->prepare("SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = %s AND site_id = %d", $option, $wpdb->siteid ) );
     3464                        $row = $wpdb->get_row( $wpdb->prepare("SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = %s AND site_id = %d", $option, $wpdb->siteid ) );
    34653465
    3466                         if ( is_null($value) )
     3466                        // Has to be get_row instead of get_var because of funkiness with 0, false, null values
     3467                        if ( is_object( $row ) )
     3468                                $value = $row->meta_value;
     3469                        else
    34673470                                $value = $default;
    34683471
    34693472                        $value = maybe_unserialize( $value );