Merge "Don't fallback from uk to ru"
[lhc/web/wiklou.git] / includes / api / ApiQueryRevisions.php
index 64022ff..3259927 100644 (file)
@@ -80,8 +80,7 @@ class ApiQueryRevisions extends ApiQueryRevisionsBase {
                        return false;
                }
 
-               return $wgUser->getEditToken(
-                       [ $title->getPrefixedText(), $rev->getUserText() ] );
+               return $wgUser->getEditToken( 'rollback' );
        }
 
        protected function run( ApiPageSet $resultPageSet = null ) {
@@ -314,7 +313,8 @@ class ApiQueryRevisions extends ApiQueryRevisionsBase {
 
                $count = 0;
                $generated = [];
-               $res = $this->select( __METHOD__ );
+               $hookData = [];
+               $res = $this->select( __METHOD__, [], $hookData );
 
                foreach ( $res as $row ) {
                        if ( ++$count > $this->limit ) {
@@ -351,7 +351,8 @@ class ApiQueryRevisions extends ApiQueryRevisionsBase {
                                        }
                                }
 
-                               $fit = $this->addPageSubItem( $row->rev_page, $rev, 'rev' );
+                               $fit = $this->processRow( $row, $rev, $hookData ) &&
+                                       $this->addPageSubItem( $row->rev_page, $rev, 'rev' );
                                if ( !$fit ) {
                                        if ( $enumRevMode ) {
                                                $this->setContinueEnumParameter( 'continue',