Make WordPress Core

Changeset 10226


Ignore:
Timestamp:
12/18/2008 10:26:57 PM (15 years ago)
Author:
ryan
Message:

Make sure get_pages cache is an array

File:
1 edited

Legend:

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

    r10222 r10226  
    21282128    extract( $r, EXTR_SKIP );
    21292129
     2130    $cache = array();
    21302131    $key = md5( serialize( compact(array_keys($defaults)) ) );
    21312132    if ( $cache = wp_cache_get( 'get_pages', 'posts' ) ) {
    2132         if ( isset( $cache[ $key ] ) ) {
     2133        if ( is_array($cache) && isset( $cache[ $key ] ) ) {
    21332134            $pages = apply_filters('get_pages', $cache[ $key ], $r );
    21342135            return $pages;
    21352136        }
    21362137    }
     2138
     2139    if ( !is_array($cache) )
     2140        $cache = array();
    21372141
    21382142    $inclusions = '';
Note: See TracChangeset for help on using the changeset viewer.