From 61ff0372e459185f642efb3f3c4d1390478e21db Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 19 Dec 2008 07:05:00 +0000 Subject: [PATCH] Make sure get_calendar cache is an array git-svn-id: http://svn.automattic.com/wordpress/trunk@10228 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 7d4f8f212c..05f294f214 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -902,14 +902,18 @@ function calendar_week_mod($num) { function get_calendar($initial = true) { global $wpdb, $m, $monthnum, $year, $wp_locale, $posts; + $cache = array(); $key = md5( $m . $monthnum . $year ); if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) { - if ( isset( $cache[ $key ] ) ) { + if ( is_array($cache) && isset( $cache[ $key ] ) ) { echo $cache[ $key ]; return; } } + if ( !is_array($cache) ) + $cache = array(); + ob_start(); // Quick check. If we have no posts at all, abort! if ( !$posts ) {