Make sure get_bookmarks cache is an array

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

View File

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