Merge "ProxyLookup: Optimise in_array in isConfiguredProxy()"
[lhc/web/wiklou.git] / includes / api / ApiQueryBlocks.php
index 8aff2aa..c5a8d08 100644 (file)
@@ -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 = [