Make WordPress Core


Ignore:
Timestamp:
12/19/2008 07:05:00 AM (17 years ago)
Author:
ryan
Message:

Make sure get_calendar cache is an array

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/general-template.php

    r10204 r10228  
    903903    global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
    904904
     905    $cache = array();
    905906    $key = md5( $m . $monthnum . $year );
    906907    if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) {
    907         if ( isset( $cache[ $key ] ) ) {
     908        if ( is_array($cache) && isset( $cache[ $key ] ) ) {
    908909            echo $cache[ $key ];
    909910            return;
    910911        }
    911912    }
     913
     914    if ( !is_array($cache) )
     915        $cache = array();
    912916
    913917    ob_start();
Note: See TracChangeset for help on using the changeset viewer.