WordPress.org

Make WordPress Core

Ticket #10091: 10091.diff

File 10091.diff, 660 bytes (added by Denis-de-Bernardy, 9 years ago)
  • wp-includes/general-template.php

     
    969969
    970970        // Quick check. If we have no posts at all, abort!
    971971        if ( !$posts ) {
    972                 $gotsome = $wpdb->get_var("SELECT 1 FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1");
     972                $gotsome = $wpdb->get_var("SELECT 1 as test FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1");
    973973                if ( !$gotsome ) {
    974974                        $cache[ $key ] = '';
    975975                        wp_cache_set( 'get_calendar', $cache, 'calendar' );