From 8427b2b756b66ca2994401abb8ddb855b8a21cc1 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 18 Dec 2008 22:26:57 +0000 Subject: [PATCH] Make sure get_pages cache is an array git-svn-id: http://svn.automattic.com/wordpress/trunk@10226 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 7cf1832816..5528f48af7 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2127,14 +2127,18 @@ function &get_pages($args = '') { $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); + $cache = array(); $key = md5( serialize( compact(array_keys($defaults)) ) ); if ( $cache = wp_cache_get( 'get_pages', 'posts' ) ) { - if ( isset( $cache[ $key ] ) ) { + if ( is_array($cache) && isset( $cache[ $key ] ) ) { $pages = apply_filters('get_pages', $cache[ $key ], $r ); return $pages; } } + if ( !is_array($cache) ) + $cache = array(); + $inclusions = ''; if ( !empty($include) ) { $child_of = 0; //ignore child_of, parent, exclude, meta_key, and meta_value params if using include