X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiComparePages.php;h=6e788d550dcdff93f2f492a5bbb38ce7849719e0;hb=cc6e850520b79758fd791204d4b49715ee235c6b;hp=e09691558c0c4dd5cb8b3a33ea4ba635b90bceed;hpb=5074ec954b4ce3890a27562163d3a7a7c7bc3495;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiComparePages.php b/includes/api/ApiComparePages.php index e09691558c..6e788d550d 100644 --- a/includes/api/ApiComparePages.php +++ b/includes/api/ApiComparePages.php @@ -26,6 +26,9 @@ use MediaWiki\Revision\RevisionArchiveRecord; use MediaWiki\Revision\RevisionStore; use MediaWiki\Revision\SlotRecord; +/** + * @ingroup API + */ class ApiComparePages extends ApiBase { /** @var RevisionStore */ @@ -231,7 +234,9 @@ class ApiComparePages extends ApiBase { */ private function getRevisionById( $id ) { $rev = $this->revisionStore->getRevisionById( $id ); - if ( !$rev && $this->getUser()->isAllowedAny( 'deletedtext', 'undelete' ) ) { + if ( !$rev && $this->getPermissionManager() + ->userHasAnyRight( $this->getUser(), 'deletedtext', 'undelete' ) + ) { // Try the 'archive' table $arQuery = $this->revisionStore->getArchiveQueryInfo(); $row = $this->getDB()->selectRow( @@ -247,6 +252,7 @@ class ApiComparePages extends ApiBase { ); if ( $row ) { $rev = $this->revisionStore->newRevisionFromArchiveRow( $row ); + // @phan-suppress-next-line PhanUndeclaredProperty $rev->isArchive = true; } } @@ -615,6 +621,7 @@ class ApiComparePages extends ApiBase { } } + // @phan-suppress-next-line PhanUndeclaredProperty if ( !empty( $rev->isArchive ) ) { $this->getMain()->setCacheMode( 'private' ); $vals["{$prefix}archive"] = true;