X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2FRevisionList.php;h=fa454e07e3b6d6fa8acfa3a2c4b2d1e3fd2cdb66;hb=9ad43405cf1d6e13375aeff460b92f400f0ab502;hp=d909a652d7f0e03c66c0b0f5737aeaa4ad9003f1;hpb=d4a1177aa66759a5cf05887830435bb9e50f7780;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/RevisionList.php b/includes/RevisionList.php index d909a652d7..fa454e07e3 100644 --- a/includes/RevisionList.php +++ b/includes/RevisionList.php @@ -22,6 +22,7 @@ use MediaWiki\MediaWikiServices; use Wikimedia\Rdbms\ResultWrapper; +use Wikimedia\Rdbms\IDatabase; /** * List for revision table items for a single page @@ -36,7 +37,7 @@ abstract class RevisionListBase extends ContextSource implements Iterator { /** @var ResultWrapper|bool */ protected $res; - /** @var bool|object */ + /** @var bool|Revision */ protected $current; /** @@ -115,7 +116,7 @@ abstract class RevisionListBase extends ContextSource implements Iterator { } public function key() { - return $this->res ? $this->res->key(): 0; + return $this->res ? $this->res->key() : 0; } public function valid() { @@ -295,15 +296,14 @@ class RevisionList extends RevisionListBase { if ( $this->ids !== null ) { $conds['rev_id'] = array_map( 'intval', $this->ids ); } + $revQuery = Revision::getQueryInfo( [ 'page', 'user' ] ); return $db->select( - [ 'revision', 'page', 'user' ], - array_merge( Revision::selectFields(), Revision::selectUserFields() ), + $revQuery['tables'], + $revQuery['fields'], $conds, __METHOD__, [ 'ORDER BY' => 'rev_id DESC' ], - [ - 'page' => Revision::pageJoinCond(), - 'user' => Revision::userJoinCond() ] + $revQuery['joins'] ); }