X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryBlocks.php;h=f9da9a3108cde4427b4f7b1c3326008fb91743fc;hb=0e2241ad6c9fd1ac055ce1a829144a021dfdb79f;hp=8aff2aa6b42fc69794fac093015f260b5b9cc748;hpb=b6a1f3bc774d043c69e9ed2875210049cdda9d68;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryBlocks.php b/includes/api/ApiQueryBlocks.php index 8aff2aa6b4..f9da9a3108 100644 --- a/includes/api/ApiQueryBlocks.php +++ b/includes/api/ApiQueryBlocks.php @@ -21,7 +21,7 @@ */ use Wikimedia\Rdbms\IResultWrapper; -use MediaWiki\Block\BlockRestriction; +use MediaWiki\MediaWikiServices; /** * Query module to enumerate all user blocks @@ -176,7 +176,7 @@ class ApiQueryBlocks extends ApiQueryBase { $this->addWhereIf( 'ipb_range_end > ipb_range_start', isset( $show['range'] ) ); } - if ( !$this->getUser()->isAllowed( 'hideuser' ) ) { + if ( !$this->getPermissionManager()->userHasRight( $this->getUser(), 'hideuser' ) ) { $this->addWhereFld( 'ipb_deleted', 0 ); } @@ -292,7 +292,8 @@ class ApiQueryBlocks extends ApiQueryBase { } } - $restrictions = BlockRestriction::loadByBlockId( $partialIds ); + $blockRestrictionStore = MediaWikiServices::getInstance()->getBlockRestrictionStore(); + $restrictions = $blockRestrictionStore->loadByBlockId( $partialIds ); $data = []; $keys = [ @@ -304,6 +305,8 @@ class ApiQueryBlocks extends ApiQueryBase { $id = $restriction->getBlockId(); switch ( $restriction->getType() ) { case 'page': + /** @var \MediaWiki\Block\Restriction\PageRestriction $restriction */ + '@phan-var \MediaWiki\Block\Restriction\PageRestriction $restriction'; $value = [ 'id' => $restriction->getValue() ]; if ( $restriction->getTitle() ) { self::addTitleInfo( $value, $restriction->getTitle() );