From cc7454270cccc9b2de79403185186733ac8b10f3 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 19 Dec 2008 07:05:51 +0000 Subject: [PATCH] Make sure get_bookmarks cache is an array git-svn-id: https://develop.svn.wordpress.org/trunk@10229 602fd350-edb4-49c9-b593-d223f7449a82 --- 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) ) {