Avoid DB_MASTER in replaceSectionAtRev()
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 6 Apr 2015 23:07:08 +0000 (16:07 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 6 Apr 2015 23:07:08 +0000 (16:07 -0700)
Bug: T92357
Change-Id: Iac4511176b5c70e9deaf71302bc1866b8b1a241a

includes/page/WikiPage.php

index b435c5c..1e7dbde 100644 (file)
@@ -1553,10 +1553,7 @@ class WikiPage implements Page, IDBAccessObject {
                        if ( is_null( $baseRevId ) || $sectionId === 'new' ) {
                                $oldContent = $this->getContent();
                        } else {
-                               // TODO: try DB_SLAVE first
-                               $dbw = wfGetDB( DB_MASTER );
-                               $rev = Revision::loadFromId( $dbw, $baseRevId );
-
+                               $rev = Revision::newFromId( $baseRevId );
                                if ( !$rev ) {
                                        wfDebug( __METHOD__ . " asked for bogus section (page: " .
                                                $this->getId() . "; section: $sectionId)\n" );