diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
commit | a2190ac74dd4d7080b12bab90e552d7aa81209ef (patch) | |
tree | 8b31f38de9882d18df54cf8d9e0de74167a094eb /includes/api/ApiQuerySiteinfo.php | |
parent | 15e69f7b20b6596b9148030acce5b59993b95a45 (diff) | |
parent | 257401d8b2cf661adf36c84b0e3fd1cf85e33c22 (diff) |
Merge branch 'mw-1.26'
Diffstat (limited to 'includes/api/ApiQuerySiteinfo.php')
-rw-r--r-- | includes/api/ApiQuerySiteinfo.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index b7b10846..12651558 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -176,6 +176,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { $data['linktrail'] = $linktrail ?: ''; $data['legaltitlechars'] = Title::legalChars(); + $data['invalidusernamechars'] = $config->get( 'InvalidUsernameCharacters' ); global $IP; $git = SpecialVersion::getGitHeadSha1( $IP ); @@ -297,6 +298,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { } } + ApiResult::setArrayType( $data, 'assoc' ); ApiResult::setIndexedTagName( $data, 'ns' ); return $this->getResult()->addValue( 'query', $property, $data ); @@ -511,6 +513,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { $groups = array_intersect( $rights[$group], $allGroups ); if ( $groups ) { $arr[$type] = $groups; + ApiResult::setArrayType( $arr[$type], 'BCarray' ); ApiResult::setIndexedTagName( $arr[$type], 'group' ); } } @@ -682,6 +685,11 @@ class ApiQuerySiteinfo extends ApiQueryBase { 'semiprotectedlevels' => $config->get( 'SemiprotectedRestrictionLevels' ), ); + ApiResult::setArrayType( $data['types'], 'BCarray' ); + ApiResult::setArrayType( $data['levels'], 'BCarray' ); + ApiResult::setArrayType( $data['cascadinglevels'], 'BCarray' ); + ApiResult::setArrayType( $data['semiprotectedlevels'], 'BCarray' ); + ApiResult::setIndexedTagName( $data['types'], 'type' ); ApiResult::setIndexedTagName( $data['levels'], 'level' ); ApiResult::setIndexedTagName( $data['cascadinglevels'], 'level' ); @@ -741,6 +749,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { global $wgParser; $wgParser->firstCallInit(); $tags = array_map( array( $this, 'formatParserTags' ), $wgParser->getTags() ); + ApiResult::setArrayType( $tags, 'BCarray' ); ApiResult::setIndexedTagName( $tags, 't' ); return $this->getResult()->addValue( 'query', $property, $tags ); @@ -750,6 +759,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { global $wgParser; $wgParser->firstCallInit(); $hooks = $wgParser->getFunctionHooks(); + ApiResult::setArrayType( $hooks, 'BCarray' ); ApiResult::setIndexedTagName( $hooks, 'h' ); return $this->getResult()->addValue( 'query', $property, $hooks ); @@ -757,6 +767,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { public function appendVariables( $property ) { $variables = MagicWord::getVariableIDs(); + ApiResult::setArrayType( $variables, 'BCarray' ); ApiResult::setIndexedTagName( $variables, 'v' ); return $this->getResult()->addValue( 'query', $property, $variables ); @@ -765,6 +776,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { public function appendProtocols( $property ) { // Make a copy of the global so we don't try to set the _element key of it - bug 45130 $protocols = array_values( $this->getConfig()->get( 'UrlProtocols' ) ); + ApiResult::setArrayType( $protocols, 'BCarray' ); ApiResult::setIndexedTagName( $protocols, 'p' ); return $this->getResult()->addValue( 'query', $property, $protocols ); @@ -792,6 +804,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { 'subscribers' => array_map( array( 'SpecialVersion', 'arrayToString' ), $subscribers ), ); + ApiResult::setArrayType( $arr['subscribers'], 'BCarray' ); ApiResult::setIndexedTagName( $arr['subscribers'], 's' ); $data[] = $arr; } @@ -842,7 +855,8 @@ class ApiQuerySiteinfo extends ApiQueryBase { 'variables', 'protocols', 'defaultoptions', - ) + ), + ApiBase::PARAM_HELP_MSG_PER_VALUE => array(), ), 'filteriw' => array( ApiBase::PARAM_TYPE => array( @@ -868,6 +882,6 @@ class ApiQuerySiteinfo extends ApiQueryBase { } public function getHelpUrls() { - return 'https://www.mediawiki.org/wiki/API:Meta#siteinfo_.2F_si'; + return 'https://www.mediawiki.org/wiki/API:Siteinfo'; } } |