aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiQueryInfo.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/api/ApiQueryInfo.php')
-rw-r--r--includes/api/ApiQueryInfo.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php
index d9aac4335ec1..ac6b9e74550c 100644
--- a/includes/api/ApiQueryInfo.php
+++ b/includes/api/ApiQueryInfo.php
@@ -26,6 +26,7 @@ use MediaWiki\MainConfigNames;
use MediaWiki\MediaWikiServices;
use MediaWiki\ParamValidator\TypeDef\TitleDef;
use MediaWiki\Permissions\PermissionStatus;
+use MediaWiki\Permissions\RestrictionStore;
/**
* A query module to show basic page information.
@@ -46,6 +47,8 @@ class ApiQueryInfo extends ApiQueryBase {
private $titleFormatter;
/** @var WatchedItemStore */
private $watchedItemStore;
+ /** @var RestrictionStore */
+ private $restrictionStore;
private $fld_protection = false, $fld_talkid = false,
$fld_subjectid = false, $fld_url = false,
@@ -106,6 +109,7 @@ class ApiQueryInfo extends ApiQueryBase {
* @param TitleFormatter $titleFormatter
* @param WatchedItemStore $watchedItemStore
* @param LanguageConverterFactory $languageConverterFactory
+ * @param RestrictionStore $restrictionStore
*/
public function __construct(
ApiQuery $queryModule,
@@ -116,7 +120,8 @@ class ApiQueryInfo extends ApiQueryBase {
TitleFactory $titleFactory,
TitleFormatter $titleFormatter,
WatchedItemStore $watchedItemStore,
- LanguageConverterFactory $languageConverterFactory
+ LanguageConverterFactory $languageConverterFactory,
+ RestrictionStore $restrictionStore
) {
parent::__construct( $queryModule, $moduleName, 'in' );
$this->languageConverter = $languageConverterFactory->getLanguageConverter( $contentLanguage );
@@ -125,6 +130,7 @@ class ApiQueryInfo extends ApiQueryBase {
$this->titleFactory = $titleFactory;
$this->titleFormatter = $titleFormatter;
$this->watchedItemStore = $watchedItemStore;
+ $this->restrictionStore = $restrictionStore;
}
/**
@@ -519,7 +525,7 @@ class ApiQueryInfo extends ApiQueryBase {
}
// Applicable protection types
$this->restrictionTypes[$title->getNamespace()][$title->getDBkey()] =
- array_values( $title->getRestrictionTypes() );
+ array_values( $this->restrictionStore->listApplicableRestrictionTypes( $title ) );
}
$linksMigration = MediaWikiServices::getInstance()->getLinksMigration();