X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiComparePages.php;h=eb67babf2ad79fb876568e0b3b78970ccd69dcbb;hb=1d6097cd360769c4f104f2c969b4b2f8a1a22adf;hp=953bc10cc3e4b4ff0dd637da7b7c67a95a54a790;hpb=6c9a2923fe1ee3a65cb027be5e781772f2b12fbd;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiComparePages.php b/includes/api/ApiComparePages.php index 953bc10cc3..eb67babf2a 100644 --- a/includes/api/ApiComparePages.php +++ b/includes/api/ApiComparePages.php @@ -175,14 +175,17 @@ class ApiComparePages extends ApiBase { $rev = Revision::newFromId( $revId ); if ( !$rev ) { // Titles of deleted revisions aren't secret, per T51088 + $arQuery = Revision::getArchiveQueryInfo(); $row = $this->getDB()->selectRow( - 'archive', + $arQuery['tables'], array_merge( - Revision::selectArchiveFields(), + $arQuery['fields'], [ 'ar_namespace', 'ar_title' ] ), [ 'ar_rev_id' => $revId ], - __METHOD__ + __METHOD__, + [], + $arQuery['joins'] ); if ( $row ) { $rev = Revision::newFromArchiveRow( $row ); @@ -285,14 +288,17 @@ class ApiComparePages extends ApiBase { $rev = Revision::newFromId( $revId ); if ( !$rev && $this->getUser()->isAllowedAny( 'deletedtext', 'undelete' ) ) { // Try the 'archive' table + $arQuery = Revision::getArchiveQueryInfo(); $row = $this->getDB()->selectRow( - 'archive', + $arQuery['tables'], array_merge( - Revision::selectArchiveFields(), + $arQuery['fields'], [ 'ar_namespace', 'ar_title' ] ), [ 'ar_rev_id' => $revId ], - __METHOD__ + __METHOD__, + [], + $arQuery['joins'] ); if ( $row ) { $rev = Revision::newFromArchiveRow( $row );