Index: trunk/phase3/includes/Revision.php |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | public static function newFromTitle( $title, $id = 0 ) { |
42 | 42 | $conds = array( |
43 | 43 | 'page_namespace' => $title->getNamespace(), |
44 | | - 'page_title' => $title->getDBkey() |
| 44 | + 'page_title' => $title->getDBkey() |
45 | 45 | ); |
46 | 46 | if ( $id ) { |
47 | 47 | // Use the specified ID |
— | — | @@ -73,7 +73,7 @@ |
74 | 74 | public static function newFromPageId( $pageId, $revId = 0 ) { |
75 | 75 | $conds = array( 'page_id' => $pageId ); |
76 | 76 | if ( $revId ) { |
77 | | - $conds['rev_id'] = $pageId; |
| 77 | + $conds['rev_id'] = $revId; |
78 | 78 | } elseif ( wfGetLB()->getServerCount() > 1 ) { |
79 | 79 | // Get the latest revision ID from the master |
80 | 80 | $dbw = wfGetDB( DB_MASTER ); |
— | — | @@ -85,6 +85,7 @@ |
86 | 86 | } else { |
87 | 87 | $conds[] = 'rev_id = page_latest'; |
88 | 88 | } |
| 89 | + $conds[] = 'page_id=rev_page'; |
89 | 90 | return Revision::newFromConds( $conds ); |
90 | 91 | } |
91 | 92 | |