Merge "Perform a permission check on the title when changing the page language"
[lhc/web/wiklou.git] / includes / page / WikiPage.php
index 9b65a33..4f4decf 100644 (file)
@@ -383,11 +383,12 @@ class WikiPage implements Page, IDBAccessObject {
                if ( is_int( $from ) ) {
                        list( $index, $opts ) = DBAccessObjectUtils::getDBOptions( $from );
                        $data = $this->pageDataFromTitle( wfGetDB( $index ), $this->mTitle, $opts );
+                       $loadBalancer = MediaWikiServices::getInstance()->getDBLoadBalancer();
 
                        if ( !$data
                                && $index == DB_REPLICA
-                               && wfGetLB()->getServerCount() > 1
-                               && wfGetLB()->hasOrMadeRecentMasterChanges()
+                               && $loadBalancer->getServerCount() > 1
+                               && $loadBalancer->hasOrMadeRecentMasterChanges()
                        ) {
                                $from = self::READ_LATEST;
                                list( $index, $opts ) = DBAccessObjectUtils::getDBOptions( $from );
@@ -1607,7 +1608,7 @@ class WikiPage implements Page, IDBAccessObject {
                $meta = [
                        'bot' => ( $flags & EDIT_FORCE_BOT ),
                        'minor' => ( $flags & EDIT_MINOR ) && $user->isAllowed( 'minoredit' ),
-                       'serialized' => $editInfo->pst,
+                       'serialized' => $pstContent->serialize( $serialFormat ),
                        'serialFormat' => $serialFormat,
                        'baseRevId' => $baseRevId,
                        'oldRevision' => $old_revision,
@@ -3000,7 +3001,7 @@ class WikiPage implements Page, IDBAccessObject {
         * @param string $token Rollback token.
         * @param bool $bot If true, mark all reverted edits as bot.
         *
-        * @param array $resultDetails Array contains result-specific array of additional values
+        * @param array &$resultDetails Array contains result-specific array of additional values
         *    'alreadyrolled' : 'current' (rev)
         *    success        : 'summary' (str), 'current' (rev), 'target' (rev)
         *
@@ -3052,7 +3053,7 @@ class WikiPage implements Page, IDBAccessObject {
         * @param string $summary Custom summary. Set to default summary if empty.
         * @param bool $bot If true, mark all reverted edits as bot.
         *
-        * @param array $resultDetails Contains result-specific array of additional values
+        * @param array &$resultDetails Contains result-specific array of additional values
         * @param User $guser The user performing the rollback
         * @param array|null $tags Change tags to apply to the rollback
         * Callers are responsible for permission checks