summaryrefslogtreecommitdiffstats
path: root/wp-includes/query.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-02 13:44:49 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-02 13:44:49 +0000
commit6d572cbe19ffedb5b92d8528798c5683154bb185 (patch)
tree4cc943e8f399addf1a10c03386342110bcc9d584 /wp-includes/query.php
parent034c1b3b665fa28816dfc6157d610c6d25fd54fe (diff)
downloadwordpress-mu-6d572cbe19ffedb5b92d8528798c5683154bb185.tar.gz
wordpress-mu-6d572cbe19ffedb5b92d8528798c5683154bb185.tar.xz
wordpress-mu-6d572cbe19ffedb5b92d8528798c5683154bb185.zip
WP Merge to rev 8216
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1344 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/query.php')
-rw-r--r--wp-includes/query.php4
1 files changed, 2 insertions, 2 deletions
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();