X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fapi%2FApiQuerySiteinfo.php;h=47212b321aa6e49bdcab0fc1bd6318be3dfb0ad2;hb=8918182ae2b7e4a8977e81528d4c796ba48232b8;hp=7e4a891adf9b9ea764c065b20b192d18fd4a37f1;hpb=f79c9e6ca3c02090d6d56eaecb2ab90d4198b2b9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 7e4a891adf..47212b321a 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -279,6 +279,8 @@ class ApiQuerySiteinfo extends ApiQueryBase { } protected function appendNamespaces( $property ) { + $nsProtection = $this->getConfig()->get( 'NamespaceProtection' ); + $data = [ ApiResult::META_TYPE => 'assoc', ]; @@ -303,6 +305,17 @@ class ApiQuerySiteinfo extends ApiQueryBase { $data[$ns]['content'] = $nsInfo->isContent( $ns ); $data[$ns]['nonincludable'] = $nsInfo->isNonincludable( $ns ); + if ( isset( $nsProtection[$ns] ) ) { + if ( is_array( $nsProtection[$ns] ) ) { + $specificNs = implode( "|", array_filter( $nsProtection[$ns] ) ); + } elseif ( $nsProtection[$ns] !== '' ) { + $specificNs = $nsProtection[$ns]; + } + if ( isset( $specificNs ) && $specificNs !== '' ) { + $data[$ns]['namespaceprotection'] = $specificNs; + } + } + $contentmodel = $nsInfo->getNamespaceContentModel( $ns ); if ( $contentmodel ) { $data[$ns]['defaultcontentmodel'] = $contentmodel;