Make WordPress Core


Ignore:
Timestamp:
12/19/2008 07:05:51 AM (16 years ago)
Author:
ryan
Message:

Make sure get_bookmarks cache is an array

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/bookmark.php

    r10150 r10229  
    143143    extract( $r, EXTR_SKIP );
    144144
     145    $cache = array();
    145146    $key = md5( serialize( $r ) );
    146     if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) )
    147         if ( isset( $cache[ $key ] ) )
     147    if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) {
     148        if ( is_array($cache) && isset( $cache[ $key ] ) )
    148149            return apply_filters('get_bookmarks', $cache[ $key ], $r );
     150    }
     151
     152    if ( !is_array($cache) )
     153        $cache = array();
    149154
    150155    $inclusions = '';
Note: See TracChangeset for help on using the changeset viewer.