X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiParamInfo.php;h=ffc3fc2e3217453123fa2e07444b4e3ff8dde744;hb=d6dcf23a8f22245e311d5582e4f9cd0f302e3738;hp=caf0cd76fc10cdf5d937e0ba9a2311b4775a8148;hpb=320e4c56132681f811c2819e3e22e98715f46ae7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiParamInfo.php b/includes/api/ApiParamInfo.php index caf0cd76fc..ffc3fc2e32 100644 --- a/includes/api/ApiParamInfo.php +++ b/includes/api/ApiParamInfo.php @@ -406,6 +406,21 @@ class ApiParamInfo extends ApiBase { $item['type'] = array_values( $item['type'] ); ApiResult::setIndexedTagName( $item['type'], 't' ); } + + // Add 'allspecifier' if applicable + if ( $item['type'] === 'namespace' ) { + $allowAll = true; + $allSpecifier = ApiBase::ALL_DEFAULT_STRING; + } else { + $allowAll = isset( $settings[ApiBase::PARAM_ALL] ) + ? $settings[ApiBase::PARAM_ALL] + : false; + $allSpecifier = ( is_string( $allowAll ) ? $allowAll : ApiBase::ALL_DEFAULT_STRING ); + } + if ( $allowAll && $item['multi'] && + ( is_array( $item['type'] ) || $item['type'] === 'namespace' ) ) { + $item['allspecifier'] = $allSpecifier; + } } if ( isset( $settings[ApiBase::PARAM_MAX] ) ) { $item['max'] = $settings[ApiBase::PARAM_MAX];