From 6d572cbe19ffedb5b92d8528798c5683154bb185 Mon Sep 17 00:00:00 2001 From: donncha Date: Wed, 2 Jul 2008 13:44:49 +0000 Subject: WP Merge to rev 8216 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1344 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/query.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'wp-includes/query.php') diff --git a/wp-includes/query.php b/wp-includes/query.php index 2806652..5f5cb3f 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -928,7 +928,7 @@ class WP_Query { $page_paths = '/' . trim($q['pagename'], '/'); $q['pagename'] = sanitize_title(basename($page_paths)); $q['name'] = $q['pagename']; - $where .= " AND (ID = '$reqpage')"; + $where .= " AND ($wpdb->posts.ID = '$reqpage')"; $reqpage_obj = get_page($reqpage); if ( 'attachment' == $reqpage_obj->post_type ) { $this->is_attachment = true; @@ -1530,7 +1530,7 @@ class WP_Query { function have_posts() { if ($this->current_post + 1 < $this->post_count) { return true; - } elseif ($this->current_post + 1 == $this->post_count) { + } elseif ($this->current_post + 1 == $this->post_count && $this->post_count > 0) { do_action('loop_end'); // Do some cleaning up after the loop $this->rewind_posts(); -- cgit