From 5183a7e18998b991bf4deabf91298504701c1e93 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 19 Dec 2008 07:05:51 +0000 Subject: [PATCH] Make sure get_bookmarks cache is an array git-svn-id: http://svn.automattic.com/wordpress/trunk@10229 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/bookmark.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-includes/bookmark.php b/wp-includes/bookmark.php index 3a04a5cd6e..af3222a1a0 100644 --- a/wp-includes/bookmark.php +++ b/wp-includes/bookmark.php @@ -142,10 +142,15 @@ function get_bookmarks($args = '') { $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); + $cache = array(); $key = md5( serialize( $r ) ); - if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) - if ( isset( $cache[ $key ] ) ) + if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) { + if ( is_array($cache) && isset( $cache[ $key ] ) ) return apply_filters('get_bookmarks', $cache[ $key ], $r ); + } + + if ( !is_array($cache) ) + $cache = array(); $inclusions = ''; if ( !empty($include) ) {