From cc7eac0320babec6a0c7a304546c58b03b0dcc1c Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 1 Jul 2011 23:46:20 +0000 Subject: [PATCH] Fixed bogus $conds in r91327 --- includes/Revision.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/Revision.php b/includes/Revision.php index fa560d30d4..93e6a05484 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -40,7 +40,7 @@ class Revision { public static function newFromTitle( $title, $id = 0 ) { $conds = array( 'page_namespace' => $title->getNamespace(), - 'page_title' => $title->getDBkey() + 'page_title' => $title->getDBkey() ); if ( $id ) { // Use the specified ID @@ -73,7 +73,7 @@ class Revision { public static function newFromPageId( $pageId, $revId = 0 ) { $conds = array( 'page_id' => $pageId ); if ( $revId ) { - $conds['rev_id'] = $pageId; + $conds['rev_id'] = $revId; } elseif ( wfGetLB()->getServerCount() > 1 ) { // Get the latest revision ID from the master $dbw = wfGetDB( DB_MASTER ); @@ -85,6 +85,7 @@ class Revision { } else { $conds[] = 'rev_id = page_latest'; } + $conds[] = 'page_id=rev_page'; return Revision::newFromConds( $conds ); } -- 2.20.1