From 1b9c2ead05d11b377d18717012e9158b5cf651e6 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 7 Dec 2006 01:06:28 +0000 Subject: [PATCH] Fix up get_page cache handling. git-svn-id: http://svn.automattic.com/wordpress/trunk@4624 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index ddfe815a5d..809b14dc4f 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -939,9 +939,9 @@ function &get_page(&$page, $output = OBJECT) { if ( isset($GLOBALS['page']->ID) && ($page == $GLOBALS['page']->ID) ) { $_page = & $GLOBALS['page']; wp_cache_add($_page->ID, $_page, 'pages'); - } elseif ( !isset($_page) && $_page == $GLOBALS['post_cache'][$blog_id][$page] ) { + } elseif ( isset($GLOBALS['post_cache'][$blog_id][$page]) ) { return get_post($page, $output); - } elseif ( isset($_page) && $_page == wp_cache_get($page, 'pages') ) { + } elseif ( $_page = wp_cache_get($page, 'pages') ) { // Got it. } else { $query = "SELECT * FROM $wpdb->posts WHERE ID= '$page' LIMIT 1";