Make sure get_calendar cache is an array

git-svn-id: http://svn.automattic.com/wordpress/trunk@10228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-12-19 07:05:00 +00:00
parent 980a3bc810
commit 61ff0372e4
1 changed files with 5 additions and 1 deletions

View File

@ -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 ) {